QUESTION IMAGE
Question
question # 2
dropdown
complete the code to check whether a string contains at least one lowercase letter.
valid = false
pw = input(\enter a password: \)
if (letter. () for letter in pw):
valid = true
Step1: Use any function
The any function in Python returns True if any element in an iterable is True. Here we want to check if any character in the password string meets the lowercase - letter condition.
any
Step2: Use islower method
The islower method of a string object returns True if the character is a lowercase letter.
islower
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
any, islower