Editor

Strong Password Check

#573 · Functions · Beginner · 35 XP · about 6 min

A sign-up page only accepts strong passwords. Write is_strong(password) that returns True when the password follows all four rules, and False otherwise:

  • it is at least 8 characters long,
  • it has at least one uppercase letter,
  • it has at least one lowercase letter,
  • it has at least one digit.

Other characters, such as ! or @, are allowed but not needed.

Examples

is_strong('Sunny2024')  # returns True
is_strong('sunny2024')  # returns False
is_strong('Sun24')      # returns False

The second password has no uppercase letter, and the third is too short.

Fastest solvers

Leaderboard

First solves only, ranked by stars and then time.