Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def mathseasy(score):
- answer1=raw_input("Select your answer ")
- if int(answer1)==answer:
- print("Well done")
- score +=1
- elif answer1.lower()==answer2:
- print("Well done")
- score +=1
- else:
- print "Wrong, it was", answer
- print "Your score is ",(str(score))
- return
- score = 0
- score =int(score)
- choice=raw_input("What type of quiz do you want to do: maths or science? ")
- topic=open("topic.txt", "a+")
- topic.write(choice + 'n')
- topic.close()
- difficulty=raw_input("What difficulty do you want to play on: easy, medium or hard? ")
- diff=open("difficulty.txt", "a+")
- diff.write(difficulty + 'n')
- diff.close()
- if choice.lower() == "maths" and difficulty.lower() == "easy":
- easym=open("mathseasy.txt" , "r")
- lines = easym.readlines()
- line0=lines[0]
- line1=lines[1]
- print(line0)
- print(line1)
- print("a. 4")
- print("b. 6")
- answer=4
- answer2=a
- mathseasy(score)
Add Comment
Please, Sign In to add comment