Question: check python code # Password_Checker_2_Damian_Oconnell_5th_June_2025 import datetime def main(): MIN_PASSWORD_LENGTH = 6 MAX_PASSWORD_LENGTH = 10 current_date_and_time = (str(datetime.datetime.today())) print(password_checker_2 program developed by Damian OConnell) password
check python code
# Password_Checker_2_Damian_Oconnell_5th_June_2025 import datetime def main(): MIN_PASSWORD_LENGTH = 6 MAX_PASSWORD_LENGTH = 10 current_date_and_time = (str(datetime.datetime.today())) print("password_checker_2 program developed by Damian OConnell") password = input("Enter a password: ") password_length = len(password) while (password_length < MAX_PASSWORD_LENGTH) or (password_length > MAX_PASSWORD_LENGTH): print("Password must be more than 6 and less than 10 characters") if password_length < MIN_PASSWORD_LENGTH: reason_password_invalid = ", Password < 6" elif password_length > MAX_PASSWORD_LENGTH: reason_password_invalid = ", Password > 10" output_file = open ("password_log_damian_oconnell.txt", "a") output_file.write(current_date_and_time) output_file.write(reason_password_invalid) output_file.write(" ") output_file.close() password = input("Enter a password: ") password_length = len(password) print("The length of the password is: ", password_length, 'Passport must be more than 6 and less than 10 characters') if password.isalpha(): print("Password weak - only contains letters") elif password.isnumeric(): print("Password is weak - contains only numbers") else: print("Your password is strong - contains both letters and numbers") input_file = open("password_log_damian_O'Connell.txt", "r") for line in input_file: print(line, end='') input_file.close()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
