Question: Good evening I have two different questions for my Python class that I need help with that I cannot seem to find out. I have
Good evening I have two different questions for my Python class that I need help with that I cannot seem to find out. I have attached a screenshot of the questons. Thank you in advance for helping with these questions. Question :
Write a function that meets the following requirements:
Creates a list with randomly chosen integers between and
Prompts the user to enter the index of the array, then displays the corresponding element value.
If the specified index is out of bounds, display the message "Out of Bounds."
Use a tryexcept for the error.
Question :
Write a program function for a hotel salesperson to enter sales in a text file. Each line contains
the following, separated by semicolons: The name of the client, the service sold such as Dinner,
Conference, Lodging and the amount of the sale. Display an error if the amount is not a number
ex: or
Write another program function that reads the file created and displays the total amount for each
service category. Display an error if the file does not exist.
"Use tryexcept for error.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
