Guest User

Untitled

a guest
Oct 28th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. print ("Welcome to my Quiz!")
  2. existing = input("Are you an existing user?: ")
  3. if existing.lower == "yes":
  4. print("Enter your credidentials")
  5. username= input("Enter your Username: ")
  6. password= input("Enter your Password: ")
  7. file= open("data.txt", "r")
  8. found=False
  9. for line in file:
  10. account = line.split(",")
  11. if account[0] == username:
  12. password= existing[1]
  13. found=True
  14. file.close()
  15. if found==True:
  16. print("Welcome Back", username ,)
  17. if found==False:
  18. print("Account not found")
  19. else:
  20. existing.lower == "no"
  21. user= input("Enter your first name: ")
  22. year= input("Enter the year you are in: ")
  23. password= input("Enter your password: ")
  24. username=user[:2]+year
  25. writefile=open("data.txt","a")
  26. writefile.write(username + "," + password + "n")
  27. writefile.close()
  28. print("Your account has been created." "Your username is..", username , "..and your password is", password,)
Add Comment
Please, Sign In to add comment