Questions =[ "Which author wrote the Harry Potter series?", "What was Gregs best freind's first and last name from the book Diary of a Wimpy Kid?", "What comic book series features a young boy and his stuffed tiger?", "Which book series did Erin Hunter write that was about cats?", "What is Rafe's imaginary freind named from the Rafe Katchadorian Series?" ] Answers = [ "J.K. Rowling", "Rowley Jefferson", "Calvin and Hobbes", "Warriors", "Leo" ] def main(): correct = 0 question = 0 name = raw_input("What's your name ") print("Hello " + name) print("PREPARE TO PLAY!") while question < 5: answer = raw_input(Questions[question]) print(answer + " " + Answers[question]) question = question + 1 if answer == Answers[question]: correct = correct + 1 print("Correct!") else: print("Incorrect") print(str(correct) + "/5 correct") main()
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