Python Programming Tutorial – 7 – if elif else

Facebook – https://www.facebook.com/TheNewBoston-464114846956315/
GitHub – https://github.com/buckyroberts
Google+ – https://plus.google.com/+BuckyRoberts
LinkedIn – https://www.linkedin.com/in/buckyroberts
reddit – https://www.reddit.com/r/thenewboston/
Support – https://www.patreon.com/thenewboston
thenewboston – https://thenewboston.com/
Twitter – https://twitter.com/bucky_roberts

Comments

Kiarash Kashani says:

wet the cardboard then rip some holes in an old bag then jam it in the holes and tape it up with some duck tape.

The Technical Fist says:

Hi sir… maybe you missed the fact about `is` or maybe you intentionally didn’t described it to keep tutorial simple.. but the `is` statement can’t be checked for equality it is used to check the identity. For example it will check weather the value that is checked in the condition is in the same memory address or not.

For example:
var1 = “TEST”
var2 = input() # Enter “TEST” in the input

if var1 is var2: # Returns false as new string is created at different memory address for var2
print(“is works”)

if var1 == var2: # Returns true as values are equal
print(“condition works”)

We should use == to check for equality and not `is` because `is` will only return true if the value is in the same memory address.

patrick matema says:

Incinerate it

Sharpirate says:

“Even though that’s illegal, we’ll do it anyways.”

Amit Afre says:

Burn it

Verax the Vigilante says:

You should recycle that cardboard. Afterall, without a planet of resources, there would be no Python.

redcrimson718 says:

After this tutorial, I had to listen to “Lucy” by Hanson, lol.

zondragon says:

elif = else if?

Become a Physicist says:

bucky= “You are the best bucky. I really love you and will watch your channel forever. I will type it 10000 times so that I will never forget it.”

A little bit of cheating with python…
bucky n * 10000

Charles chen says:

put it in other people’s trash can…

Jaden Visscher says:

I made a simple program asking whether you prefer marvel or dc:

preference = input(“Do you prefer Marvel or DC”)

if preference is “Marvel”:
print(“You win!”)
elif preference is “DC”:
print(“Boooo!”)
else:
print(preference + ” is not an option”)

print(“Thank you for contributing”)

Whenever I run this program, it tells me whatever I typed is not an option. I’m running python 3.5.3. Thanks.

theMelvinShow says:

if name is “xxx” is not working for some reason, I have to use
if name == “xxx” for some reason…

Eyyub Aydin says:

Best Python Tutorial on youtube.

Paweł Brysch says:

if a

MJ Sanchez says:

Just cut your cardboard into one inch squares with a sharp steak knife.
Then you can place the cardboard squares into a plastic trash bag.

q zorn says:

gee what next, card-broad cops? thanks. :-  Oh, are there videos on the Rock64 sbc (2018)?

Lucario Salcedo says:

you are the best

SnippleSnapple says:

Wait, somehow the first line always has 2 errors and 1 typo for me. What did I do wrong? I typed in exactly as it is! I’m confused! Someone help!

TenthYoung says:

Put the shredded cardboard into a plastic container, it may cost like $10-30 to buy the plastic container. Get some sharpie and write, “Does not contain cardboard.” Put it into dumpster.

Leye Oyelami says:

i just figured python is also capital sensitive because when i ran the command and had name = “lucy” it did not print the result corresponding to lucy. unless I typed “Lucy” with the capital L. Great tutorial so far. thank you.

sriram pingali says:

can i just write multipe if rather than writing multiple elif?
what is the purpose of an elif statement?

Israel Karity says:

i m with bucky through C, C++, C# HTML +CSS +Java+ JQuery+Javascript and this is the funniest tutorial of them all

ThologY says:

How is this guy not the best python teacher

Volatile Troupe says:

drag the cardboard into a recycle bin….the computer recylce bin

عبد الله says:

Burn it

Shiraj Sharma says:

Bucky i am using anaconda spyder for coding since my i am done dealing with plugins in pycharm and anaconda is very easy to use so will it create a problem

blsh 12 says:

u r really gosh good

ansishihi says:

that storytime in the beginning was awesome xD

Guillermo Garcia says:

I think you will use a if with “if age < 18"

kolton laws says:

we could make a drinking game for every time you say “umm” XD

tkrudi says:

Bucky Roberts is the best online teacher ever!

Priya Vadgama says:

Is elfif the same as then??

Peter Parkinson says:

reassemble the torn up box with duct tape, fill it with empty cans of tuna and mail it to the department of sanitation.

The_Aalian says:

any help with the trash man

 Write a comment

*

Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!