Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. userinput = input("Username: ")
  2. userinput += ".txt"
  3. file = open(userinput, "w")
  4. passchoice = input("Password: ")
  5. file.write(passchoice)
  6. print("")
  7. userinput = input("Username: ")
  8. userinput += ".txt"
  9. file = open(userinput, "r")
  10. password = file.readline()
  11. file.close()
  12. passinput = input("Password: ")
  13. if(password == passinput):
  14. print("HUZZAH!")
  15.  
  16. userinput = input("Username: ")
  17. userinput += ".txt"
  18. file = open(userinput, "w")
  19. passchoice = input("Password: ")
  20. file.write(passchoice)
  21. file.write("/n") #Note the addition of the newline
  22. print("")
  23. userinput = input("Username: ")
  24. userinput += ".txt"
  25. file = open(userinput, "r")
  26. password = file.readline()
  27. file.close()
  28. password = password.strip("") #stripping whitespace as instructed
  29. passinput = input("Password: ")
  30. if(password == passinput):
  31. print("HUZZAH!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement