Turn the following code into a procedure. Pass the input file
and the amount of PM 10 to the procedure. It will print the city
name and the pollution values for all cities that have that much PM
10 pollution or more.
Save & Run Load History 4 5 = 6 1 inFile = open("uspoll.txt","r") 2 line = infile.readline() 3 while line: values = line.split(":") pollution = float(values[1]) if (pollution > 25): print('City: ', values[0]) print("Pollution values:", values[1],values[2]) 9 line = inFile.readline() 10 11 inFile.close() 12 7 8
Turn the following code into a procedure. Pass the input file and the amount of PM 10 to the procedure. It will print th
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Turn the following code into a procedure. Pass the input file and the amount of PM 10 to the procedure. It will print th
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!