Guest User

Untitled

a guest
Dec 3rd, 2018
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. login = False
  2. EnterUserName = input("Enter your username: ")
  3. ValidUserName = False
  4. ValidPassWord = False
  5.  
  6. file = open("LoginDetails.CSV","r")
  7. for line in file:
  8. details = line.split(",")
  9. UserName = details[0]
  10. PassWord = details[1]
  11.  
  12. while ValidUserName == False:
  13. if EnterUserName == UserName:
  14. print("Username Correct! ")
  15. ValidUserName = True
  16.  
  17. if ValidUserName != True:
  18. print("Incorrect Password - Try again!")
  19. ValidUserName = False
  20.  
  21. while ValidPassWord == False:
  22. if ValidUserName == True:
  23. EnterPassWord = input("Enter your password: ")
  24. if EnterPassWord == PassWord:
  25. print("Password Correct! ")
  26. ValidPassWord = True
  27.  
  28. if ValidPassWord != True:
  29. print("Incorrect Password - Try again!")
  30.  
  31. if ValidUserName and ValidPassWord == True:
  32. print("=================")
  33. print("Login Successful!")
  34. print("=================")
Add Comment
Please, Sign In to add comment