If Statement in Python
If Statement in Python
Endif
If ( age < 18) : if the answer is true or right immediately the
next line is executed
print (" you can not drive ")
Endif
if you focused in above program we will deduct the following
1- if the answer of question ( if age < 18) is age less than 18 ? answer is YES or TRUE
that is mean this person can not drive a car
2- the next line will be executed immediately in case the answer of if statement is true
3- if the answer of question or statement if ( if age < 18) that is mean his age if bigger
than 18 ? answer will be FALSE or NO the program will go to ENDIF to finish the
program
Cont. If statement with testing two cases Else statement
2020-03-11 10:30:08
if ( age <18 ):
print ("you can not drive) in case of true your age is less than
18 and go to ENDIF
else in case of False your age is bigger
than 18 and go to Endif
print (" you can drive a car" )
endIf