Guest User

GEORGE HAZEL

a guest
May 9th, 2018
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.91 KB | None | 0 0
  1. import time
  2.  
  3.  
  4.  
  5.  
  6. print("Welcome to the topic quiz")
  7. print("Have you previously logged in?")
  8. login = input()
  9. if login.lower()=="no":
  10. print("Okay before we can start please enter your first name")
  11. firstname = input()
  12. print ("How old are you?")
  13. age = input()
  14. print ("And finaly what year group are you in?")
  15. year = input()
  16. print ("we are generating your unique username...")
  17. time.sleep(5)
  18. username = firstname[0]+firstname[1]+firstname[2]+age
  19. print ("Your username is,",username)
  20. print ("For security purposes please input a password for your account")
  21. password = input()
  22. # this section was copied from the NEA tool kit - algorithms - example 5 - login systems
  23. writefile = open("Secure.csv","a")
  24. writefile.write(username + "," + password + "\n")
  25. writefile.close()
  26. print ("Success")
  27. print ("In order for us to secure your account please login")
  28. username = input("Please enter your username:")
  29. password = input("Please enter your password:")
  30. file=open("Secure.csv","r")
  31. found = False
  32. for line in file:
  33. details=line.split(",")
  34. if details[0].strip() == username and details[1].strip() == password:
  35.  
  36. found = True
  37. else:
  38. found == False
  39.  
  40. if found == True:
  41. print("Welcome to the gaming topic quiz")
  42. print("Would you like easy, medium or hard difficulty")
  43. difficulty = input()
  44. if difficulty.lower()=="easy":
  45. print ("You have chosen the easy difficulty")
  46. print ("Question 1")
  47. print ("How many titles have there currently been in the Call of Duty franchise?")
  48. print (" a) 14")
  49. print (" b) 17")
  50. answer = input()
  51. if answer.lower()=="17":
  52. print ("correct")
  53. else:
  54. print ("inncorrect")
  55. print ("Question 2")
  56. print ("What space is diagonally opposite from Go on a standard Monopoly board?")
  57. print (" a) Go to jail")
  58. print (" b) Free Parking")
  59. answerq = input()
  60. if answerq.lower()=="free parking":
  61. print ("correct")
  62. else:
  63. print ("inncorrect")
  64. print ("Question 3")
  65. print ("What is the evolution of Jigglypuff?")
  66. print (" a) Wigglypuff")
  67. print (" b) Igglypuff")
  68. answerw = input()
  69. if answerq.lower()=="wigglypuff":
  70. print ("correct")
  71. else:
  72. print ("inncorrect")
  73. print ("Question 4")
  74. print ("When was the game Grand Theft Auto San Andreas released?")
  75. print (" a) 20 November 2005 ")
  76. print (" b) 26 October 2004")
  77. answere = input()
  78. if answere.lower()=="26 October 2004":
  79. print ("correct")
  80. else:
  81. print ("incorrect")
  82. print ("Question 5")
  83. print ("When was the platform Roblox first founded?")
  84. print (" a) 2004")
  85. print (" b) 2006")
  86. answerr = input()
  87. if answerr.lower()=="2004":
  88. print ("correct")
  89. else:
  90. print ("incorrect")
  91.  
  92.  
  93.  
  94.  
  95. elif found == False:
  96. print("incorect login details entered")
  97.  
  98.  
  99. else:
  100. print ("Please login")
  101. username = input("Please enter your username:")
  102. password = input("Please enter your password:")
  103. file=open("Secure.csv","r")
  104. found = False
  105. for line in file:
  106. details=line.split(",")
  107. if details[0] == username and details[1] ==password:
  108. found = True
  109. print("Welcome to the topic quiz")
  110. if found == False:
  111. print("incorect login details entered")
Add Comment
Please, Sign In to add comment