Kodewick
Start learning →
Mini challenge←→0 / 100

Password check

#039Mini challengeStringsLoops6 min

Sign-up checks the password: at least 8 characters, at least one digit and at least one capital letter. Write strong_password(password) to return True when all three are met, otherwise False.

Examples
strong_password("Sunny2024")→True
strong_password("sunny2024")→False
strong_password("Sun1")→False
main.py
def strong_password(password):
    has_digit = False
    has_upper = False
    for ch in password:
        # your code here: a digit sets has_digit to True;
        # a capital sets has_upper to True
        pass
    # your code here: 8 or more long, and both found
    return False
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.