Python 3
The passwords.csv is as shown below
Validate Passwords in Check File March2021 INVALID iudj8&neB09 Valid MyDogWo0f INVALID mv3m959 INVALID ven1vid1v1c1Iulius INVALID 123456789 INVALID abcdefgcijk INVALID What#ItN0w INVALID windsofchange INVALID HelloMyNameIs INVALID 4584208 INVALID 4586300 INVALID Anniv&0629 Valid BDay@1955 INVALID BigBadW0d! Valid !Rf0donotcare Valid R85r!4L145 Valid S3att!eWa Valid SONameHere INVALID Abc!23 INVALID
Format Lines for Report Use the following format lines to produce correctly formatted output. Header print( "\n\n%62s" % "Validate Passwords in Check File\n" ) Detail Line Valid Passwords print( "%40s\tValid" % word ) Invalid Passwords print( "%40s\t\t\tINVALID" % word ) Where “word“ is the name used to address individual entries in the List returned from buildList.
Transcribed Image Text: Process:
1. Ask the user for the name of an input file (a test file is provided).
2. Open the file for input
3. Pass the file to a FUNCTION (buildList) you will define that will:
a. Accept an input file
b. Return a List
c. The function will read the input file, separating individual passwords and storing
the passwords in a List structure.
4. Pass the List created in the previous step to a FUNCTION (buildDictionary) you
will define that will:
a. Accept a List
b. Return a Dictionary
c. Create the Dictionary based on the lengths of the passwords in the List
received. Each entry in the dictionary will consist of a KEY (the password length)
and a VALUE (the count of passwords of that length). See Expected Output for
details.
5. Print a report based on the Dictionary created in step #4.
a. Print report and column headers using provided format lines.
b. Print one line per Dictionary entry, using the provided format line.
c. Expected output for report is included in these instructions.
6. Produce a report indicating the validity or invalidity of each password:
a. Print a report header line using the provided format line.
b. Print individual detail lines for the report by:
Passing each individual string to a FUNCTION (validatePassword) you
will define that will:
1. Accept a string value
2. Return a boolean value
3. Determine whether the received string is a valid password based
on the following rules:
a. The string must be AT LEAST 8 characters long
b. The string must contain AT LEAST 1 UPPER CASE letter
c. The string must contain AT LEAST 1 LOWER CASE letter
d. The string must contain AT LEAST 1 instance of one of the
following SPECIAL CHARACTERS: $, !, &, *.
4. Return True if the string passes all tests. Return False if the string
fails at least one test.
• Write an output line based on the return value form the previous step,
using the provided format lines.