import time def menu(): name = raw_input ("what is your name? if you wish not to enter your name type n/a") if name == "n/a": name = "user" time.sleep(2) print "Menu" print "" time.sleep(1) print "option 1 - ask the creator questions" print "option 2 - maths quiz" print "option 3 - geography quiz" print "option 4 - quit" A = True while A == True: select = raw_input ("what option number would you like to do? ") if select == 1: option1() A = False elif select == 2: option2() A = False elif select == 3: option3() A = False elif select == 4: print "goodbye" A = False else: A = True def option1(): print "The questions you can ask the creator are as follows." time.sleep(1) print "1.How old are you?" time.sleep(1) print "2.How long have you been programming?" time.sleep(1) print "3.What is your favourite programming language?" time.sleep(2) BB = True while BB == True: question = raw_input("What question number would you like to ask?) if question == 1: print "I am 15" BB = False elif question == 2: print "A few years" BB = False elif question == 3: print "Python(this one)" BB = False else: print "Enter a number for the question you want to ask." AA = True while AA == True: men = raw_input("would you like to return to menu? yes or no") if men == "yes": AA = False menu() elif men == "no": AA = False print "goodbye" else: print "type the answer in lower case and write the whole word."
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