Editor

Password Strength Check

Beginner · Write the code · from 50 Python Practice Problems with Instant Answer Checking (Beginner to Advanced)

From the lesson: 50 Python Practice Problems with Instant Answer Checking (Beginner to Advanced)

Fifty problems, each with a code editor and real tests. Write your solution, press Check, and see exactly which cases pass. Stuck? Hints reveal one at a time, and the solution unlocks once you have checked at least once. Your code and progress are saved in this browser.

Read the lesson

Write password_problems(pw) that returns a list of the rules the password breaks, in this order:

1. "too short" if it has fewer than 8 characters

2. "no digit"

3. "no uppercase"

4. "no lowercase"

A strong password returns [].

def password_problems(pw):
pass
Solution unlocks after your first Check

What Check runs

Your code runs first, then each of these lines. The output must match exactly.

RunsExpected output
password_problems("Secur3pass")[]
password_problems("abc")['too short', 'no digit', 'no uppercase']

More practice problems

All Python exercises · 50 practice problems