Text processing · 13 / 14 Exercise Medium

Validate password

Objective

Create a Python program that checks whether a password meets some rules and says which ones it breaks.

Instructions

  • Read a password.
  • Check these rules, in this order: at least 8 characters, at least one capital letter, at least one lower-case letter and at least one digit (isupper(), islower(), isdigit()).
  • For each rule that is not met, show a line: Must have at least 8 characters, Missing an uppercase letter, Missing a lowercase letter or Missing a digit.
  • If all of them are met, show only Valid password.
Input
abc
Output
Must have at least 8 characters
Missing an uppercase letter
Missing a digit

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise