#Programming Test #Zachary Baker #And Arin Mauk #October 31st class ProgQuestion (qest, ans, oans, ooans): programming_question = qest correct_answer = ans second_incorrect_answer = ooans incorrect_answer = oans user_input = "" def askQuestion (self): print(programming_question + "\n Choose An Answer and enter 1,2, or 3 and press Enter") user_input = raw_input() check_if_user_correctly_answered_question() def check_if_user_correctly_answered_question(self): if user_input == correct_answer: user_correctly_answered_question() else: user_incorrectly_answered_question() def user_correctly_answered_question(self): print(" You got it correct!") def user_incorrectly_answered_question(self): print(" You got the question wrong!")
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