Thanks :)
The problem is that the teacher has not yet gone through that variant and expects us to do it in the basic way
I tried to do it in this way, but it's says that "list index out of range".
Could you have helped me with that?
heating_data = [[50,15,25,10],[100,13,65,15],[25,32,67,80]]
for i in range (len(heating_data)):
m1 = heating_data[i][0]
t1 = heating_data[i][1]
t2 = heating_data[i][2]
s = heating_data[i][3]
C = 4.19
Q = m1*C*(t2-t1)
energy = Q*(2.7778*10**-7)
price = energy * s
print ([[m1,t1,t2,s,Q,energy,price]])
energi_cost = [[Q,energy,s],[Q,energy,s],[Q,energy,s]]
energi_cost = [i][0]
energi_cost = [i][1]
energi_cost = [i][2]
print(energi_cost)
round (energy,3)
round (price,2)
The problem is that the teacher has not yet gone through that variant and expects us to do it in the basic way
I tried to do it in this way, but it's says that "list index out of range".
Could you have helped me with that?
heating_data = [[50,15,25,10],[100,13,65,15],[25,32,67,80]]
for i in range (len(heating_data)):
m1 = heating_data[i][0]
t1 = heating_data[i][1]
t2 = heating_data[i][2]
s = heating_data[i][3]
C = 4.19
Q = m1*C*(t2-t1)
energy = Q*(2.7778*10**-7)
price = energy * s
print ([[m1,t1,t2,s,Q,energy,price]])
energi_cost = [[Q,energy,s],[Q,energy,s],[Q,energy,s]]
energi_cost = [i][0]
energi_cost = [i][1]
energi_cost = [i][2]
print(energi_cost)
round (energy,3)
round (price,2)