Please help me understand if and else statements in coding of python!!!!!!!
Answers
Answered by
1
It is just like other languages. The else statement is combined with the if statement, so if the if statement is false or 0 the program will execute the else statement automatically. Example(very easy): if it is raining outside use a umbrella else stay at home; if you look over here it says if it is raining outside use a umbrella but in case it isn't raining it will execute the else statement. Syntax:
if expression:
statement(st)
else expression:
statement(st)
Similar questions