I have
expected_values =
[[name, 4, 8, 3]
[name, 2, 6, 9]
[name, 3, 6, 2]]
and I want to do something similar to dividing the 2nd value by the 1st value, then multiply that by 3, then append the value to the end of the list. So the final product would look like
expected_values =
[[name, 4, 8, 3, 6]
[name, 2, 6, 9, 9]
[name, 3, 6, 2, 6]]
What I have so far is
for name in range(0,len(expected_values)):
total = 0
pa = expected_values[name][1]
pa = int(pa)
for s in range(0,len(expected_values)):
singles = expected_values[s][2]
singles = int(singles)
total = total + ((singles/pa)*3)
expected_values.append(total)
I have int(pa) in there because it's being imported from a CSV file and apparently it imports everything as strings, so I have to convert it to do any math on it.
I'm very new to Python -- doing this as a summer project to learn the language -- and I'm kind of shaky on the indexing of lists within lists, especially inside these loops.