Guest User

Untitled

a guest
Oct 2nd, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. #user registration system and login
  2. users={}
  3. choice=''
  4. while choice !='q':
  5. choice=input("Do you want to register R/L :")
  6. if choice == 'R':
  7. username=input("Please enter username here")
  8. password=input("Enter your password")
  9. if username == '' :
  10. print("Please enter this field,not to be empty")
  11. choice = input("Do you want to register R/L :")
  12. elif password == '':
  13. print("Please enter this field,not to be empty")
  14. choice = input("Do you want to register R/L :")
  15. else:
  16. users[username] = username
  17. users[password] = password
  18. print("you registered successfully")
  19. print("Now you can login here")
  20. login = input("Hello, Enter Username")
  21. if login in users:
  22. pass = input("Now enter thw password")
  23. if pass != password:
  24. print("Password not correct")
  25. break
  26. else:
  27. print("You have successfully Login:")
  28. break
  29. else:
  30. print("You are not Registered")
  31. break
  32.  
  33. elif choice == 'L':
  34. login = input("Hello, Enter Username")
  35. if login in users:
  36. pass = input("Now enter the password")
  37. if pass != password:
  38. print("Password not correct")
  39. break
  40. else:
  41. print("You have successfully Login:")
  42. break
  43. else:
  44. print("You are not Registered")
  45. break
Add Comment
Please, Sign In to add comment