This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hey all,
First week with programming and I am working my way through the beginner project list I found here (https://docs.google.com/document/d/1TyqD2_oDtiQIh_Y55J5RfeA91JJECc97xYIKM112H9I/edit )
I tried magic 8 ball this evening and figured it out pretty quickly once I found some documentation on random.choice()
Can anyone give feedback on how I did it vs some other ways I might have approached it? Secondly, what are good beginner resources on GUI/adding simple buttons? I want to go for that bonus challenge.
import random
import time
answers = ['Yes','No','Maybe','Ask later']
play_again = "Yes"
while play_again == "Yes" or "Y" or "Yes." or "Ok":
input('Please ask me a Yes/No question. ')
print('\nThinking..\n')
time.sleep(3)
print(random.choice(answers))
play_again = input('Would you like to play again? ')
Thank you!
Subreddit
Post Details
- Posted
- 5 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/learnpython...