Password Validator

You are tasked to create a password validation system. If the password does not meet the following criteria, a ValueError should be raised with an appropriate error message of what went wrong (see the examples):
  1. The password must have at least 8 characters.
  1. The password must contain at least 1 number.
  1. The password must include at least 1 uppercase letter.
  1. The password must have at least one special character (.,:;!?()[]{}<>+=-*%/$^|@#&_~`).
If the password passes all checks, the program should print: Your password is valid!
Input
Output
abcdefg
ValueError: The password must have at least 8 characters.
abcdefgh
ValueError: The password must contain at least one number.
abcdefgh1
ValueError: The password must include at least one uppercase letter.
Abcdefgh1
ValueError: The password must have at least one special character.
Abcdefgh1!
Your password is valid!
 

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue