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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
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

Post 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 50 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply