Question: PYTHON PROGRAM The Program Spec Write a program that reads in a filename provided by the user, opens it and reads all of the lines.

PYTHON PROGRAM

PYTHON PROGRAM The Program Spec Write a program that reads in a

filename provided by the user, opens it and reads all of the

The Program Spec Write a program that reads in a filename provided by the user, opens it and reads all of the lines. Create a dictionary to hold the ine numbers for each valid identifier found. Your solution will need to process each line to determine whether a valid identifier exists on that line and if so, record both the line number and identifier found in the dictionary. A valid identifier must be a string consisting of only letters, numbers and underscores. If a line contains an invalid identifier no record is made in the dictionary. If a line contains a valid identifier already recorded in the dictionary append the line number to the dictionary log of where the identifier was found

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!