question 49 Loops & Iteration · hard
Explain why a password is weak
A sign-up page lists every rule a password breaks, so people fix them all at once. The rules: at least 8 characters, at least one digit, at least one capital letter, and no spaces. Print one line per broken rule, in that order, or Strong when none is broken.
First line
password = "sunny day7". Check runs your program again with other passwordsPrints
Needs a capital letter, then No spaces allowedMessages
Too short, Needs a digit, Needs a capital letter, No spaces allowedCapitalsthe letters in
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"Expected output2 lines
- 1Needs a capital letter
- 2No spaces allowed