import time import random responses = ["Maybe, depends on what the big guy up there is thinkin'","Why don't you ask someone else?",\ "I dunno...seems kind of impossible...", "YES! A million times yes!", "Uh, duh, isn't it obvious?", "Mmmm...no...JUST KIDDING! Yes, yes, yes.", "I think so???? Idk, sorry..."] def what(): while True: raw_input("Ask a 'yes' or 'no' question, and you will be enlightened...> ") print "...thinking...hold on a minute..." time.sleep(3) resp() choice = raw_input("Would you lke to continue? Press 'q' to leave, and 'enter' if u wish to stay.") if choice == 'q': break def resp(): resp = responses[random.randint(0,6)] print resp what()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question