Python 3.8.2
How do I pass result to a variable for the next loop? It would then be over written for the following loop.
Example:
5
10
15
10
2
4
5+10
10+15
15+10
10+2
2+4
Thanks
- Loop through CSV file and add row to variable for next loop?
Code:
with open('final-output.csv') as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
for row in readCSV:
result = round(float(row[0]),1)
How do I pass result to a variable for the next loop? It would then be over written for the following loop.
Example:
5
10
15
10
2
4
5+10
10+15
15+10
10+2
2+4
Thanks