Question: . Create a Python program file called Ch 1 0 - 1 _ Name.py . ( Replace Name with your initial of first name and

. Create a Python program file called Ch10-1_Name.py.(Replace Name with your initial of first name and first 5 letters of last name. If your last name is shorter than 5 letters, just use full last name, it doesn't have to be 5 letters. i.e. if your name is John Doe, your file name should be Ch10-1_JDoe.py)
2. Your program will take a file name from user and find out occurrences of characters (only alpha numeric characters, no special characters should be included) in the file. Upper and lower characters need to be counted as same characters for this assignment.You need to use Python Dictionary and tuples for this assignment. Your output should be sorted ascending order of frequencies. Do not use "Read" method to read the entire file in. Sort by values instead of keys
If user enters wrong information (wrong name of the file or non-existing file name), your program needs to display message and ask for correct input. Your program should not generate traceback message with any input.
Your program's output should be exactly same or very close to the sample output provided. Output should be formatted to match the sample output provided or points will be deducted (up to 8 points).
OUTPUT:
=================== RESTART: C:/Jason/PCC/Python/ch10-1.py ===================
Please enter file name to process: sample10-1.txt
[(1,'b'),(1,'m'),(1,'v'),(1,'x'),(1,'y'),(3,'g'),(3,'w'),(4,'c'),(6,'d'),(6,'f'),(6,'u'),(11,'p'),(13,'r'),(14,'s'),(15,'i'),(15,'n'),(16,'a'),(17,'h'),(17,'l'),(25,'t'),(30,'o'),(33,'e')]
Do you want to try another file? (y or n)y
Please enter file name to process: Ch10-data2.txt
[(2,'x'),(4,'v'),(4,'y'),(5,'b'),(7,'c'),(7,'k'),(8,'p'),(9,'g'),(10,'f'),(10,'m'),(10,'w'),(13,'d'),(14,'l'),(14,'r'),(15,'h'),(16,'u'),(17,'s'),(18,'i'),(22,'a'),(26,'n'),(27,'o'),(36,'t'),(40,'e')]
Do you want to try another file? (y or n)n
Thank you for playing.
>>>

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 Programming Questions!