if grade >= 90:
print('A')
elif grade >= 80:
print('B')
elif grade >= 70:
print('C')
elif grade >= 60:
print('D')
else:
print('F')
Multi-way selection
- You can also use the word
elif
in case you need to check a condition after other condition isFalse
. In this way, we have multiple branches, for more than two alternatives.