if expression:
statements
Indentation => which space at the beginning of a line , to delimit blocks of code
if 10 >5:
print(" 10 greater than 5 ")
print (" End ")
Notice the colon at the end of the expression in the if statement.
As the program contains multiple lines of code, you should create it as a separate file and run it
If statements can be nested
num = 12
if num >5
print ("Bigger than 5")
if num <=47
print ("Between 5 and 47")
No comments:
Post a Comment