Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import string
- def validatePassword(somePassword):
- lowerCase = ""
- for x in range(0 , len(somePassword)+1):
- if (somePassword[x].isupper() == True):
- lowerCase = True
- else:
- lowerCase = False
- print(lowerCase)
- def main():
- print("Please input passwords one-by-one for validation.")
- print("Input END after you've entered your last password.")
- userPassword = ""
- myList = []
- while (userPassword != "END"):
- userInput = input("")
- if (userInput == "END"):
- break
- else:
- myList.append(userInput)
- for password in myList :
- validOrInvalid = validatePassword(password)
- if (validOrInvalid == "lowerCase = False"):
- print("Password " + password + " is bad. It contains no lower case letters.")
- elif (validOrInvalid == "uowerCase = False"):
- print("Password " + password + " is bad. It contains no upper case letters.")
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement