Advertisement
Guest User

Untitled

a guest
Feb 6th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. userFile=open("user.txt","a+")
  2. userFile.write("welcome to the amazing quiz ")
  3.  
  4. close="no"
  5. while close != "yes":
  6. #this is the login code
  7. name =input("create a username: ")
  8. password =input("create a password: ")
  9. print("Thank you, you have now created a username and password.")
  10. command = None
  11. input1 = None
  12. input2= None
  13.  
  14. while input1 !=name:
  15. input1 = input("enter your username to access the quiz: ")
  16. while input2 !=password:
  17. input2 = input("enter your password please to access the quiz: ")
  18. print("welcome to your quiz!")
  19. if name == name:
  20. print("Thank you, you will now be entered into the quiz")
  21.  
  22.  
  23.  
  24.  
  25. #this saves in to the text file userFile
  26. userFile.write(input("what is your first name? " ))
  27. userFile.write(input("what is your surname? " ))
  28. userFile.write(input("what is your age? " ))
  29. userFile.write(input("what is your year group? " ))
  30. userFile.write(input("what is your username? The username is made up from the first 3 letters of Their name and their age" ))
  31.  
  32.  
  33. #the difficulty the user wants
  34. difficulty=int(input(("What difficulty would you like to do the topic on 1=easy 2=medium 3=hard:")))
  35. if difficulty=='1':
  36. print("So you want to do a quiz on easy")
  37. print("Do you want to do it on Maths or Computer Science? If you want to do it on Maths type '1' if you want to do Computer Science type'2'")
  38. choice=input()
  39. if choice=='1':
  40. print("So you want to do Easy Maths")
  41. import easymaths
  42. elif choice=='2':
  43. print("So you want to do Easy Computer Science")
  44. import computersciencequestions
  45. elif difficulty=='2':
  46. print('So you want to do a quiz on medium')
  47. print("Do you want to do it on Maths or Computer Science? If you want to do it on Maths type '1' if you want to do Computer Science type'2'")
  48. if choice=='1':
  49. print('Medium maths')
  50. import mediummaths
  51. elif choice =='2':
  52. print("so you want to do medium quiz computer science")
  53. import computersciencequestions
  54. elif difficulty=='3':
  55. print('So you want to do a quiz on Hard')
  56. print("Do you want to do it on Maths or Computer Science? If you want to do it on Maths type '1' if you want to do Computer Science type'2'")
  57. if choice=='1':
  58. print('Medium maths')
  59. import mediummaths
  60. elif choice =='2':
  61. print("so you want to do medium quiz computer science")
  62. import computersciencequestions
  63.  
  64.  
  65.  
  66.  
  67.  
  68. userFile.close()
  69. close=input("Thank you for taking part in the quiz,now Please type yes to exit the quiz\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement