Advertisement
Guest User

Untitled

a guest
Mar 30th, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. print("Welcome...")
  2. welcome = input("Do you have an acount? y/n: ")
  3. if welcome == "n":
  4. while True:
  5. username = input("Enter a username:")
  6. password = input("Enter a password:")
  7. password1 = input("Confirm password:")
  8. if password == password1:
  9. file = open(username+".txt", "w")
  10. file.write(username+":"+password)
  11. file.close()
  12. welcome = "y"
  13. break
  14. print("Passwords do NOT match!")
  15.  
  16. if welcome == "y":
  17. while True:
  18. login1 = input("Login:")
  19. login2 = input("Password:")
  20. file = open(login1+".txt", "r")
  21. data = file.readline()
  22. file.close()
  23. if data == login1+":"+login2:
  24. print("Welcome")
  25. break
  26. print("Incorrect username or password.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement