Question: My code is supposed to check if the password entered meets the requirements , it asks for a password but it returns everything as valid

My code is supposed to check if the password entered meets the requirements , it asks for a password but it returns everything as valid , my code is below . python programming thanks you My code is supposed to check if the password entered meets the

# get password from user

password = input ("enter password:")

valid = False

# check for pasword requirements 1-6 characters

if(len(password)>6 and len(password)

uppercase_letter = False number = False # for loop checks for password for upper and lowercase requirerments

for character in password: if(character.isupper()): uppercase_letter = True if(character.islower()): lowercase_letter = True if(character.isdigit()): number = True if(lowercase_letter and uppercase_letter and number): valid = True break # if statement to check password is valid

if(valid): print("password is not good")

else: print("password is good")

Problem You are creating a new account and need to provide a password. The password has the following requirements: (a) The password must be at least 6 characters and at most 20 characters. (b) It must contain at least one lowercase letter, one uppercase letter, and one number. Write a program that prompts the user to input a password and checks if the password is valid. If the password is valid, print a confirmation statement. If it is not, print a statement that the password is not valid

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!