Guest User

Untitled

a guest
Oct 28th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 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,)
  29.  
  30. print("Welcome to my Quiz!")
  31.  
  32. existing = input("Are you an existing user?: ")
  33.  
  34.  
  35. if existing.lower() == "yes":
  36. print("Enter your Credidentials")
  37.  
  38. username = input("Enter your Username: ")
  39. password = input("Enter your Password: ")
  40.  
  41. with open("data.txt", "r") as raw_data:
  42. my_data = raw_data.read()
  43.  
  44. re_data = my_data.split('n')
  45.  
  46. for lines in re_data:
  47.  
  48. split_line = lines.split(',')
  49.  
  50. if username == split_line[0] and password == split_line[1]:
  51. print("Welcome Back " + username)
  52.  
  53. else:
  54. print("Account not found")
  55.  
  56. else:
  57.  
  58. user = input("Enter your first name: ")
  59. year = input("Enter the year you are in: ")
  60. password = input("Enter your password: ")
  61. username = user[:2]+year
  62.  
  63. save_box = username + "," + password + "n"
  64.  
  65. with open("data.txt", "a") as raw_data:
  66. raw_data.write(save_box)
  67.  
  68. print("Your account has been created." "Your username is.." + username + "..and your password is" + password)
  69.  
  70.  
  71. print("Goodbye, Have a Nice Day ...")
  72.  
  73. jack,6354734346534
  74. edward,45645646754
  75. jeje,874574574587
  76.  
  77. print ("Welcome to my Quiz!")
  78. existing = input("Are you an existing user?: ")
  79. if existing.lower()[0] == "y":
  80. print("Enter your credidentials")
  81. username= input("Enter your Username: ")
  82. password= input("Enter your Password: ")
  83. file= open("data.txt", "r")
  84. found=False
  85. for line in file:
  86. account = line.strip().split(",")
  87. if account[0] == username:
  88. password= account[1]
  89. found=True
  90. file.close()
  91. if found==True:
  92. print("Welcome Back", username )
  93. else:
  94. print("Account not found")
  95. else:
  96. #print("Account not found")
  97. #existing.lower() == "no"
  98. user= input("Enter your first name: ")
  99. year= input("Enter the year you are in: ")
  100. password= input("Enter your password: ")
  101. username=user[:2]+year
  102. writefile=open("data.txt","a")
  103. writefile.write(username + "," + password + "n")
  104. writefile.close()
  105. print("Your account has been created." "Your username is..", username , "..and your password is", password,)
Add Comment
Please, Sign In to add comment