Created
February 5, 2018 03:56
-
-
Save oilsinwater/5fcc4b2332ddd64d95042c3b24f5db51 to your computer and use it in GitHub Desktop.
Magic8ball.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def getAnswer (answerNumber): | |
if answerNumber == 1: | |
return 'It is certain' | |
elif answerNumber == 2: | |
return 'It is decidely so' | |
elif answerNumber == 3: | |
return 'Yes' | |
elif answerNumber == 4: | |
return 'Reply hazy try again' | |
elif answerNumber == 5: | |
return 'Ask again later' | |
elif answerNumber == 6: | |
return 'Concentrate and ask again' | |
elif answerNumber == 7: | |
return 'My reply is no' | |
elif answerNumber == 8: | |
return 'Outlook not so good' | |
elif answerNumber == 9: | |
return 'Very doubtful' | |
r = random.randint(1, 9) | |
fortune = getAnswer(r) | |
print(fortune) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment