User:Kithira/Course Pages/CSCI 12/Assignment 2/Group 1/Homework 4: Difference between revisions
Content deleted Content added
→Code:: edited phrasing |
m →Code:: edited code further and updated the description |
||
Line 7:
def summarize(x, y, z):
sumT = 0
val1 = 0
for i in range(40):
sumT = sumT + val2
val1 = val2
return sumT
</source>
This code represents the function Summarize, which summarizes each input using <math>|
<source lang="python">
Line 27 ⟶ 32:
row = line.split(",")
res = summarize(float(row[1]), float(row[2]), float(row[3]))
▲ if res > 5.0:
▲ res = 0
lis = lis + res
ave = lis/60.0
Line 36 ⟶ 39:
</source>
The second part of code is responsible for averaging the values over a minute then adding all the minutes to find a total result that determines the intensity classification
|