Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.04 KB | None | 0 0
  1. import string
  2.  
  3. def validatePassword(somePassword):
  4.     lowerCase = ""
  5.     for x in range(0 , len(somePassword)+1):
  6.         if (somePassword[x].isupper() == True):
  7.             lowerCase = True
  8.         else:
  9.             lowerCase = False
  10.     print(lowerCase)
  11.        
  12.    
  13.      
  14.    
  15.    
  16.     def main():
  17.     print("Please input passwords one-by-one for validation.")
  18.     print("Input END after you've entered your last password.")
  19.          
  20.     userPassword = ""
  21.     myList = []
  22.  
  23.     while (userPassword != "END"):
  24.           userInput = input("")
  25.  
  26.           if (userInput == "END"):
  27.               break
  28.           else:
  29.               myList.append(userInput)
  30.  
  31.     for password in myList :
  32.         validOrInvalid = validatePassword(password)
  33.         if (validOrInvalid == "lowerCase = False"):
  34.             print("Password " + password + " is bad. It contains no lower case letters.")
  35.         elif (validOrInvalid == "uowerCase = False"):
  36.             print("Password " + password + " is bad. It contains no upper case letters.")
  37. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement