Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

complete the code to check whether a string is between eight and 11 cha…

Question

complete the code to check whether a string is between eight and 11 characters

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: Check for too long condition

We want to set a condition for when the password is too long. Since we want the length between 8 and 11, if the length is greater than 11, it's too long. So the first condition should be lengthPW > 11.

Step2: Check for too short condition

We need to set a condition for when the password is too short. If the length is less than 8, it's too short. So the second condition should be lengthPW < 8.

Answer:

The first blank should be filled with > 11 and the second blank should be filled with < 8