Conditions
Conditions
b) if condition:
statements1
statements2
else:
statements3
statements4
c) if condition1:
statements1
statements2
elif condition2:
statements3
statements4
elif condition3:
statements5
statements6
else:
statements7
Example:-
10<20 #True
‘gang’ < ‘God’ # False because Lower case > uppercase.
recipient
Example 3: Determining the grade based on a score
score = float(input("Enter the score: "))
if score >= 90:
grade = 'A'
elif 80 <= score < 90:
grade = 'B'
elif 70 <= score < 80:
grade = 'C'
else:
grade = 'D'