if-elif-else structure : If « Language Basics « Python
- Python
- Language Basics
- If
if-elif-else structure

import random
mood = random.randrange(3)
if mood == 0:
print mood
elif mood == 2:
print mood
else:
print "Illegal mood value!."
Related examples in the same category