Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print ("Welcome, please log in below to use this application")
- Username = "seanboyd"
- Password = "password"
- def username(username):
- promptusername = input("Enter Username: ")
- return promptusername
- def main():
- print("Welcome to the main page")
- def mainLogin():
- if username(username) == Username:
- print("login successfull")
- main()
- elif username(username) != Username:
- print ("login failed, try again")
- mainLogin()
- mainLogin()
- And this is the results of when I run it in pycharm. As you can see it wont fail on the first bad username:
- Welcome, please log in below to use this application
- Enter Username: dhdgdd
- Enter Username: dgddgd
- login failed, try again
- Enter Username:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement