Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. print ("Welcome, please log in below to use this application")
  2.  
  3. Username = "seanboyd"
  4. Password = "password"
  5.  
  6.  
  7.  
  8. def username(username):
  9. promptusername = input("Enter Username: ")
  10. return promptusername
  11.  
  12. def main():
  13. print("Welcome to the main page")
  14.  
  15. def mainLogin():
  16. if username(username) == Username:
  17. print("login successfull")
  18. main()
  19. elif username(username) != Username:
  20. print ("login failed, try again")
  21. mainLogin()
  22.  
  23. mainLogin()
  24.  
  25.  
  26.  
  27. And this is the results of when I run it in pycharm. As you can see it wont fail on the first bad username:
  28.  
  29. Welcome, please log in below to use this application
  30. Enter Username: dhdgdd
  31. Enter Username: dgddgd
  32. login failed, try again
  33. Enter Username:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement