Question: Given a file Air_pollution_data.txt which contains three cities and four pollution PM10 (Particulate matter less than 10 microns) values for different cities for Monday, Tuesday,

 Given a file "Air_pollution_data.txt" which contains three cities and four pollution

Given a file "Air_pollution_data.txt" which contains three cities and four pollution PM10 (Particulate matter less than 10 microns) values for different cities for Monday, Tuesday, Wednesday, and Thursday. (Assuming that the file exists): Air_pollution_data.txt content: CityA 92 89 121 103 CityB 66 54 78 89 CityC 56 45 77 97 Write a Python scripting to do the following: a) Open the file for read and read the above information from the file for each city by splitting the data line by line using for loop and split() method. b) Compute the lowest pollution PM10 values for each city. c) Compute the average pollution PM10 values for each city. d) The program should print the following output on the screen: (Note: All variables are need to be calculated then printed) City's lowest and average pollution PM10 For CityA, the lowest pollution PM10 value is 89, and the average pollution PM10 value is 101.25 For CityB, the lowest pollution PM10 value is 54, and the average pollution PM10 value is 71.75 For CityC, the lowest pollution PM10 value is 45, and the average pollution PM10 value is 68.75

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!