Question: please use python - You will need to create the file names.txt and add names to it for this Python module. This file should be
- You will need to create the file names.txt and add names to it for this Python module. This file should be at the same location in PyCharm as the Python module. - Your Python Module must compile. - You should accomplish each requirement defined below. - You must upload the completed Python module (file) with the name Pythonmidterm.py. - Amenu should be displayed to the user-with the options L,M, and R. - You must prompt the user to enter a menu selection. The menu will have the following selections (NOTE: all menu selections by the user should not be case sensitive): 1. ' 'L'-Length a. Assume that a file containing a series of names is called names. txt and exists on the computer's disk. Read that file and display the length of each name in the file to the screen. Each name's length should be displayed on a line by itself. Display the length of each name on a line by itself. 2. ' M ' - Middle Characters a. Assume that a file containing a series of names is called names. txt and exists on the computer's disk. Read that file and display the middle character or the middle characters of each name in the file. Display each on a line by itself. 3. ' R '-Reverse a. Assume that a file containing a series of names is called names. txt and exists on the computer's disk. Read that file and display each name in the file in reverse to the screen. Display each on a line by itself. 4. If any menu selection other than ' L, ' M ', or ' R ' is entered a. Display the message 'You entered an invalid menu selection' to the user
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
