Моля за помош! Задача Functions - Exercise 06. Password Validator 0/100 Къде грешаа?!
⦁ Password Validator
Write a function passwordValidator(password) that checks if a given password is valid. Password validations are:
⦁ The length should be 6 - 10 characters (inclusive)
⦁ It should consists only of letters and digits
⦁ It should have at least 2 digits
If a password is valid print "Password is valid".
If it is NOT valid, for every unfulfilled rule print a message:
⦁ "Password must be between 6 and 10 characters"
⦁ "Password must consist only of letters and digits"
⦁ "Password must have at least 2 digits"
Examples
Input Output
passwordValidator('logIn') Password must be between 6 and 10 characters
Password must have at least 2 digits
passwordValidator('MyPass123') Password is valid
passwordValidator('Pa$s$s') Password must consist only of letters and digits
Password must have at least 2 digits