Python 3 Programming Tutorial: If Else

preview_player
Показать описание
The If-Else statement is designed to build on the if statement's logic. Here, we ask if something is the case, and, if it is we do something. Then we say otherwise, which is contingent on the previous if statement, do something else. If the previous if statement is true, then the else will not run. If the if statement is false, then the else statement will run.

In this python programming tutorial video you are shown how to use the if-else statements together.

Bitcoin donations: 1GV7srgR4NJx4vrk7avCmmVQQrqmv87ty6
Рекомендации по теме
Комментарии
Автор

I have to go to your videos because my computer programming teacher isn't great at explaining and I would like a nice grade. Thanks!

yliahhh
Автор

Best basic python series... even better than some of the paid courses!

great work

andrejohan
Автор

Best coding Channel very clearly explained 👏🏼👏🏼👏🏼👏🏼

thecraftscolumn
Автор

Thankyou for this video it really helped me do my homework :)

isaacjohnson
Автор

It is indeed because of you that i am getting the simplest and the best teaching for python fundamentals

pratikthorat
Автор

You're great at explaining this stuff man, thank you for posting these vids- very helpful

johnbannister
Автор

Great series Sentdex, you helped me learn python over a weekend! General question, how do you make a new column and have an if-then statement in the new column? Example, I have two columns with different string lengths and I want a new column that will use either column if the length of the string is 13.

ahowlmx
Автор

I had a constant error with using else but thanks to your help i managed to create my first if else code and im really happy :D
Thank you!

WeedShinigami
Автор

Thankyou, just starting to learn python. subscribed.

mrhunterf
Автор

Your way of explaining very impressive ✌️

mannukaur
Автор

I like the large font you use it's easy to see the code, Thanks.

suemendez
Автор

BOTH if statements are running. It is the statements UNDER the if statements that may or may not be running, depending on the result of the comparison in the if statement.

GrantSR
Автор

python 3.6.ob4 is telling me the else statement and the elif statements are invalid syntax

isaiahtrigo
Автор

I just typed this out and there's an error code around my 'else'. I don't know what to that means.

LOUDMOUTHTYRONE
Автор

can you put multiple strings after an if statement, before putting another if or else statement?

kevinphillips
Автор

Hi this is very easy to follow, very helpful. Thanks !

veronicatoby
Автор

I am new to python taking a intro to programming and having a hard time understanding exactly what the program wants me to do. May anyone assist me on what I am doing wrong?
here is the problem
Given that ph refers to a float, write a statement that compares ph to 7.0 and makes the following assignments (RESPECTIVELY!) to the variables neutral, base, and acid:

0, 0, 1 if ph is less than 7
0, 1, 0 if ph is greater than 7
1, 0, 0 if ph is equal to 7


This is what I have
if ph < 7.0 :
ph = neutral

elif ph > 7.0 :
ph = base

else ph == 7.0 :
ph = acid

christinamoreno
Автор

So would the else help incase you flip the greater less than?

hair
Автор

Ya, but how do you do a double else statement??? Like this:

If ~~~~:

Else:

Else:



The 2nd else statement would be for both the if stamement and the 1st else statement.

therealmaxflyman
Автор

benjamin heb je die foutmelding al verbeterd of niet

oshknosh
visit shbcf.ru