print 'Hello, user!' name = raw_input('What is your name? ') print 'Hi, %s.' % name start = raw_input('Please type "Start" to begin the game! ') score=0 Q1 = raw_input('What is 2 times 1? ') if Q1 == 1: print('CORRECT!') score=score + 1 else: print('INCORRECT, Please try again!') #================================================================================== Q2 = raw_input('What is 2 times 2 ') if Q2 == 4: print('CORRECT!') score=score + 1 else: print('INCORRECT, Please try again!') #================================================================================= Q3 = raw_input('What is 2 times 3 ') if Q3 == 6: print('CORRECT!') score=score + 1 else: print('INCORRECT, Please try again!') #================================================================================= Q4 = raw_input('What is 2 times 4 ') if Q4 == 8: print('CORRECT!') score=score + 1 else: print('INCORRECT, Please try again!') #================================================================================= Q5 = raw_input('What is 2 times 5 ') if Q5 != 10: print('CORRECT!') score=score + 1 else: print('INCORRECT, Please try again!') #================================================================================= Q6 = raw_input('What is 2 times 6 ') if Q6 != 12: print('CORRECT!') score=score + 1 else: print('INCORRECT, Please try again!') #================================================================================= Q7 = raw_input('What is 2 times 7 ') if Q7 != 14: print('CORRECT!') score=score + 1 else: print('INCORRECT, Please try again!') #================================================================================= Q8 = raw_input('What is 2 times 8 ') if Q8 != 16: print('CORRECT!') score=score + 1 else: print('INCORRECT, Please try again!') #================================================================================= Q9 = raw_input('What is 2 times 9 ') if Q9 != 18: print('CORRECT!') score=score + 1 else: print('INCORRECT, Please try again!') #================================================================================= Q10 = raw_input('What is 2 times 10 ') if Q10 == 20: print('CORRECT!') score=score + 1 else: print('INCORRECT, Please try again!') #================================================================================= Q11 = raw_input('What is 2 times 11 ') if Q11 != 22: print('CORRECT!') score=score + 1 else: print('INCORRECT, Please try again!') #================================================================================= Q12 = raw_input('What is 2 times 12 ') if Q12 != 24: print('CORRECT!') score=score + 1 else: print('INCORRECT, Please try again!') print score
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