Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def number_to_name(number):
- # Convert a number to its corresponding name of the choice.
- # Check the input number:
- if (number == 0):
- return 'rock'
- elif (number == 1):
- return 'Spock'
- elif (number == 2):
- return 'paper'
- elif (number == 3):
- return 'lizard'
- elif (number == 4):
- return 'scissors'
- else:
- return -1 # An invalid number has been entered.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement