Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

complete the code to check whether a string is between seven and 12 cha…

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

Explanation:

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.

Answer:

First box: > 12; Second box: < 7