password_strength(pw) that rates a password string as "Weak", "Medium", or "Strong". A password is "Strong" if it has length >= 8, contains at least one digit, and at least one uppercase letter. It is "Medium" if it has length >= 8 but is missing a digit or an uppercase letter. Otherwise it is "Weak".password_strength("Abcdef12")"Strong"
Length 8+, has a digit and an uppercase letter.
password_strength("abcdefgh")"Medium"
Length 8+ but no digit and no uppercase letter.
password_strength("abc")"Weak"
Too short.
Use `any(c.isdigit() for c in pw)` and `any(c.isupper() for c in pw)`.
Check length first as a guard before checking the other two conditions.