Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. user = input("Set a username: ")
  2. password = input("Set a password: ")
  3. while True:
  4.     userIn = input("Enter username: ")
  5.     if userIn == user:
  6.         print("Correct")
  7.         while userIn == user:
  8.             passIn = input("Enter password: ")
  9.             if passIn == password:
  10.                 print("Logged in as", user)
  11.                 break
  12.             else:
  13.                 print("Incorrect, try again")
  14.     else:
  15.         print("Incorrect, try again")
  16.         continue
  17.     break #why is this break statement executed after the inner while break statement is executed?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement