Page 1 of 1

Turn the following code into a procedure. Pass the input file and the amount of PM 10 to the procedure. It will print th

Posted: Fri May 20, 2022 5:26 pm
by answerhappygod
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.
Turn The Following Code Into A Procedure Pass The Input File And The Amount Of Pm 10 To The Procedure It Will Print Th 1
Turn The Following Code Into A Procedure Pass The Input File And The Amount Of Pm 10 To The Procedure It Will Print Th 1 (31.48 KiB) Viewed 52 times
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