Question: using the below python code Iyou need to add in the following, code needs to be in the basic form as used and not using
using the below python code Iyou need to add in the following, code needs to be in the basic form as used and not using "true" statements, assignment is as follows Assignment Part 3 - PasswordChecker3
This assessment has 3 submissions:
- Design Clarification Meeting
- Video and Client Sign-off
- Final PasswordChecker Submission
Scenario Your IT Team Leader has asked for another updated version of the PasswordChecker program that meets the requirements below. This version does not use the previous code, so your IT Team Leader would like to meet with you to discuss the task to ensure you have a clear understanding of the requirements before you write the Python code.
Program Specification - PasswordChecker3
Description
A password log fileITWorks_password_log.txt has been provided withthe date/time and reason the password is invalid. Read the data from the file into a list. Using the list output each line. As you output each line from the list, count the number of errors for passwords that were below the minimum length and count the number of passwords that were above the maximum length. Output the counts to the screen.
Inputs
| Name | Description | Data Type | Source |
| ITWorks_password_log.txt | File containing the date/time and reason the password is invalid | string | file |
Processing
Read the contents of the password log file and add this to a list
Use the list to output each line and count of the number of errors for passwords that were below the minimum length and a count of the number of passwords that were above the maximum length.
Display both counts to the screen
Outputs
| Name | Description | Data Type | Destination |
| line | Contents of each line in the list | String | Screen |
| count_pw_too_small | This is the count of how many passwords were below the minimum length | integer | Screen |
| count_pw_too_large | This is the count of how many passwords were above the maximum length | integer | Screen |
code being used - just needs to be edited to fit the above # Password_Checker_2_Damian_O'Connell_5th_June_2025 import datetime def main(): MIN_PASSWORD_LENGTH = 6 MAX_PASSWORD_LENGTH = 10 current_date_and_time = (str(datetime.datetime.today())) password = input("Enter a password: ") password_length = len(password) while password_length < MIN_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_O'Connell.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) 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() main()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
