Guest User

Untitled

a guest
Nov 18th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. def mathseasy(score):
  2. answer1=raw_input("Select your answer ")
  3. if int(answer1)==answer:
  4. print("Well done")
  5. score +=1
  6. elif answer1.lower()==answer2:
  7. print("Well done")
  8. score +=1
  9. else:
  10. print "Wrong, it was", answer
  11. print "Your score is ",(str(score))
  12. return
  13.  
  14. score = 0
  15. score =int(score)
  16.  
  17. choice=raw_input("What type of quiz do you want to do: maths or science? ")
  18. topic=open("topic.txt", "a+")
  19. topic.write(choice + 'n')
  20. topic.close()
  21. difficulty=raw_input("What difficulty do you want to play on: easy, medium or hard? ")
  22. diff=open("difficulty.txt", "a+")
  23. diff.write(difficulty + 'n')
  24. diff.close()
  25.  
  26. if choice.lower() == "maths" and difficulty.lower() == "easy":
  27. easym=open("mathseasy.txt" , "r")
  28. lines = easym.readlines()
  29. line0=lines[0]
  30. line1=lines[1]
  31. print(line0)
  32. print(line1)
  33. print("a. 4")
  34. print("b. 6")
  35. answer=4
  36. answer2=a
  37. mathseasy(score)
Add Comment
Please, Sign In to add comment