Sorry, can you help me? I'm trying to calculate the values for the same key, exported form csv file:
dd = {}
with open('input_1.csv') as File:
reader = csv.reader(File, delimiter=';')
g=list(reader)
for key,value in g.items():
key = row[0]
value = int(row[1])
if key in reader:
dd[key] += value
print(dd)
It comes out:
File "C:/Users/User/Documents/Visual Studio 2017/DjangoWebProject1/DjangoWebProject1/app/6_8.py", line 20, in <module>
for key,value in g.items():
AttributeError: 'list' object has no attribute 'items'