Advertisement
Guest User

Username and Password Code 3

a guest
Apr 30th, 2019
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. # different way to write code, neater?
  2. print ('Welcome to your program! We need to check some things to make sure it\'s you.')
  3. # username input and check
  4. while True:
  5.     print ('What is your username?')
  6.     username = input()
  7.     if username == 'emilymercurio':
  8.         break
  9.     else:
  10.         print ('Incorrect. Try again.')
  11. # password input and check      
  12. while True:
  13.     print ('What is your password?')
  14.     password = input()
  15.     if password == '123':
  16.         break
  17.     else:
  18.         print ('Incorrect, try again.')
  19.  
  20. print ('Access Granted!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement