syntax if python code example
Example 1: if statement python
#a statement that checks if a condition is correct
#example:
x=5
if x == 5:
print("x is 5")
else:
print("x is not 5")
Example 2: python if
if num<5:
print('Num less than 5')
elif 5<= num <=9:
print('Num between 5 and 9')
else:
print('Num more than 9')