Write a program to build a program that checks if the password meets the required requirements in python
Requirements and Specifications
This week's assignment involves writing a Python assignment program to determine whether a password exactly meets the following requirements for a secure password: The length of the password must greater than some minimum length and less than some maximum. You should decide on the minimum (at least 6) and maximum (at least 15) allowable lengths. It must not include any spaces. It must contain at least one digit It must contain at least one alphabetic character. Your program must contain at least three functions: one function to check that the password is the proper length a second function to check whether it contains the required number of characters/digits. Hint: to determine whether it contains at least one digit and one alphabetic character, use a loop and the isalpha or isdigit methods. a third function to verify that it does not contain the prohibited character (space). Your program should prompt the user for the candidate password and then each function and display either that the password is valid or the first reason it is invalid. You cannot use Regular Expressions (RE) ! ****Break**** For context, this is an entry level class so the code cant be too advanced. Also, last week we learned loops and this week we are covering strings.
def check_length(password):return 6 <= len(password) <= 15def check_required_symbols(password):has_digit = Falsehas_alpha = Falsefor c in password:if c.isalpha():has_alpha = Trueif c.isdigit():has_digit = Truereturn has_digit and has_alphadef check_prohibited_symbols(password):for c in password:if c == ' ':return Falsereturn Trueif __name__ == '__main__':password = input('Please, input password to check: ')if not check_length(password):print('Password has wrong length')elif not check_required_symbols(password):print('Password does not have a digit or letter')elif not check_prohibited_symbols(password):print('Password contains spaces')else:print('Password is valid')