I need clear step by step solution. Do not use (append format,items..etc) Only using Try, if, elif,
Question:
I need clear step by step solution. Do not use (append format,items..etc)
Only using Try, if, elif, except., file open..etc I need clear solution exactly as in the output sample A hotel keeps records of its sales in a text file (called "hotel.txt"; provided in the MOODLE). Each line contains the following information separated by semicolons ("-):The client's name, the service sold (such as Dining, conference...), and the amount of the sale. Figure 2a shows a sample input file. Write a program that reads such a file and displays the total and average amount for each service category (sample output is shown in figure 2b). Knowing that there are four services (Dining, Lodging Conference, and Parking). A hotel may not sell all type of services. For example, in the given hotel.txt' file, the Parking service is not used. Display an error using the proper exception if .The file does not open/exist .The format of the data in the file is incorrect (e.g sale amount "230,9" or "2ab") .Dividing by zero (when computing average) Make sure you always close any open files (even if an error occurs). 3 Service l Average 8833ss Benjamin Bayer:Dining:26.5 English Joyce A:Lodging:120.14 Zalaya:Lodging: 173.6 Chung-cha kim:Conference:425 Davidson:Dining: 15.6 Rohan Panchal:Dining:36.9 883883 Dining 2208 44.16 Lodging 544.0 181.35 Conference 425.0 425.00 Dividing by Zero, this hotel service not used Barbara Benson:Dining:45.8 Smith John B:Lodging:250.3 Wong, Fanklin:Dining:96 Figure 2b Output sample exe2 Figure 2a input file sample exe?