Question: Loops. This code verifies a user's password and prints it if it satisfies all requirements, otherwise it keeps asking the user for a password. Please

 Loops. This code verifies a user's password and prints it if
it satisfies all requirements, otherwise it keeps asking the user for a
password. Please rea the code and answer the following five questions about
it. import re p_lower re.compile(r'[a-z]') p_upper = re.compile('[A-Z]') p_digit = re.compile('[0-9]') p_symbol
= re.compile(r'[@#$%&?! ]') while True : password input("A password should have at
least one lowercase let ter, In one uppercase letter, one digit, and

Loops. This code verifies a user's password and prints it if it satisfies all requirements, otherwise it keeps asking the user for a password. Please rea the code and answer the following five questions about it. import re p_lower re.compile(r'[a-z]') p_upper = re.compile('[A-Z]') p_digit = re.compile('[0-9]') p_symbol = re.compile(r'[@#$%&?! ]') while True : password input("A password should have at least one lowercase let ter, In one uppercase letter, one digit, and a special character: @#$%&?! \ Please enter your password: ") m_lower - p_lower.search(password) m_upper = p_upper.search(password) m_digit - p_digit.search(password) m_symbol - p_symbol.search(password) if not m_lower : print ("You need to use a lowercase letter.") continue if not m_upper : print ("You need to use an uppercase letter.") continue if not m_digit : print ("You need to use a digit.") continue if not m_symbol: print ("You need to use a special character.") continue break print("Your password is set to {password).") Note: The question order is shuffled by default in quizzes on Canvas. I f you want to do the questions in order, then answers questions labeled as Q1 then 02 then 03 then 04 then Q5. Problem 1 Q5. How the break statement should be modified to fix the program? What header with a Boolean expression should be placed before the break statement? if : break if m_lower or m_upper or m_digit or m_symbol: if m_lower and m_upper and m_digit and m_symbol: delete the break statement no modification is necessary Problem 1. Q2. If the user enters "hello" what lines are printed in the output? Check all lines that are printed. You need to use a lowercase letter. You need to use a digit. You need to use an uppercase letter. You need to use a special character. Your password is set to hello. Problem 1 Q4. If continue statements are removed, does the program behave correctly? If the program does not behave correctly, what statement causes it and should be modified? Check all that apply. none if not m_lower: if not m_symbol: print("Your password is het to (password}") continue if not m_upper : if not m_digit : Obreak Problem 1. Q3. If you want the program to show the user all mistakes she or he made when writing a password at once, what statements do you need to delete? none O continue print statement O break Problem 1 Q1. If the user enters "Airbender", what lines are printed to the program output? Check all lines that are printed. You need to use an uppercase letter. You need to use a special character. You need to use a digit. Your password is set to Airbender. You need to use a lowercase letter

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!