Guest User

Untitled

a guest
Nov 17th, 2017
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. firstname = input("First name: ")
  2. surname = input("Surname: ")
  3. age = int(input("Age: "))
  4. password = input("Password: ")
  5.  
  6. username = firstname[:3] + str(age)
  7.  
  8. with open("account.txt","a",newline="") as myfile:
  9. writer = csv.writer(myfile)
  10. writer.writerow([username,password,firstname,surname,age])
  11. myfile.close()
  12.  
  13. menu()
  14.  
  15. user0 = input("Username: ")
  16. pass0 = input("Password: ")
  17.  
  18.  
  19. file = open("account.txt","r")
  20.  
  21. for line in file:
  22. details = line.split(",")
  23.  
  24.  
  25.  
  26. if user0 == details[0] and pass0 == details[1]:
  27. print("Correct!")
  28. else:
  29. print("Fail")
  30.  
  31.  
  32. menu()
  33.  
  34. selection = int(input("1 or 2: "))
  35.  
  36. if selection == 1:
  37. register()
  38. else:
  39. login()
Add Comment
Please, Sign In to add comment