Advertisement
scipiguy

NCCE Python Course Gap Task

Jul 30th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1. userName=input("Enter a username:")
  2. while len(userName) < 2 or len(userName) > 10:
  3.     userName = input("Enter a username:")
  4.  
  5. validPassword = False
  6. while validPassword == False:
  7.     password = input("Enter a new password:")
  8.     if password.lower() == password:
  9.         print("You password must contain an uppper case character")
  10.     elif password.upper() == password:
  11.         print("You password must contain a lower case character")
  12.     else:
  13.         print("Password case correct")
  14.         validPassword = True
  15.  
  16. print("\n=== Menu ===")
  17. print("1. Add Students")
  18. print("2. Search Students")
  19. print("3. Sort Students")
  20. print("4. Log out\n")
  21.  
  22. validChoice = False
  23.  
  24. while validChoice == False:
  25.     choice = input("Enter an option 1-4: ")
  26.     if choice in ["1", "2", "3", "4"]:
  27.         print("You have chosen option " + choice)
  28.         validChoice = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement