Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- print("Welcome to the topic quiz")
- print("Have you previously logged in?")
- login = input()
- if login.lower()=="no":
- print("Okay before we can start please enter your first name")
- firstname = input()
- print ("How old are you?")
- age = input()
- print ("And finaly what year group are you in?")
- year = input()
- print ("we are generating your unique username...")
- time.sleep(5)
- username = firstname[0]+firstname[1]+firstname[2]+age
- print ("Your username is,",username)
- print ("For security purposes please input a password for your account")
- password = input()
- # this section was copied from the NEA tool kit - algorithms - example 5 - login systems
- writefile = open("Secure.csv","a")
- writefile.write(username + "," + password + "\n")
- writefile.close()
- print ("Success")
- print ("In order for us to secure your account please login")
- username = input("Please enter your username:")
- password = input("Please enter your password:")
- file=open("Secure.csv","r")
- found = False
- for line in file:
- details=line.split(",")
- if details[0].strip() == username and details[1].strip() == password:
- found = True
- else:
- found == False
- if found == True:
- print("Welcome to the gaming topic quiz")
- print("Would you like easy, medium or hard difficulty")
- difficulty = input()
- if difficulty.lower()=="easy":
- print ("You have chosen the easy difficulty")
- print ("Question 1")
- print ("How many titles have there currently been in the Call of Duty franchise?")
- print (" a) 14")
- print (" b) 17")
- answer = input()
- if answer.lower()=="17":
- print ("correct")
- else:
- print ("inncorrect")
- print ("Question 2")
- print ("What space is diagonally opposite from Go on a standard Monopoly board?")
- print (" a) Go to jail")
- print (" b) Free Parking")
- answerq = input()
- if answerq.lower()=="free parking":
- print ("correct")
- else:
- print ("inncorrect")
- print ("Question 3")
- print ("What is the evolution of Jigglypuff?")
- print (" a) Wigglypuff")
- print (" b) Igglypuff")
- answerw = input()
- if answerq.lower()=="wigglypuff":
- print ("correct")
- else:
- print ("inncorrect")
- print ("Question 4")
- print ("When was the game Grand Theft Auto San Andreas released?")
- print (" a) 20 November 2005 ")
- print (" b) 26 October 2004")
- answere = input()
- if answere.lower()=="26 October 2004":
- print ("correct")
- else:
- print ("incorrect")
- print ("Question 5")
- print ("When was the platform Roblox first founded?")
- print (" a) 2004")
- print (" b) 2006")
- answerr = input()
- if answerr.lower()=="2004":
- print ("correct")
- else:
- print ("incorrect")
- elif found == False:
- print("incorect login details entered")
- else:
- print ("Please login")
- username = input("Please enter your username:")
- password = input("Please enter your password:")
- file=open("Secure.csv","r")
- found = False
- for line in file:
- details=line.split(",")
- if details[0] == username and details[1] ==password:
- found = True
- print("Welcome to the topic quiz")
- if found == False:
- print("incorect login details entered")
Add Comment
Please, Sign In to add comment