QUESTION IMAGE
Question
complete the code to check whether a string is between seven and 12 characters long.
is the password at least six characters long?
lengthpw = len(pw)
if lengthpw
message = \your password is too long.\
valid = false
elif lengthpw
message = \your password is too short.\
valid = false
Step1: Analyze the first condition
The first condition checks if the password is too long. Since the maximum length is 12, the condition should be lengthPW > 12.
Step2: Analyze the second condition
The second condition checks if the password is too short. Since the minimum length is 7 (as we want it between 7 and 12), the condition should be lengthPW < 7.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
First box: > 12; Second box: < 7