A list b is like:
X = [((a,b),12),((c,d),34),...]
for i in range(0,5):
print X[i][0][0],X[i][1],X[i][0][1]
I want to save my data in a csv
file. Eg. This can be saved as :
a,12,b
- in first row (which isX[0][0][0], X[0][1]
)c,34,d
- in my second row and so on.
This is part of my project and I have no idea about .csv
file.
What I did
writer= csv.writer(open('dict.csv','wb'))
for i in range(0,5):
writer.writerow([x[i][0][0],x[i][1],x[i][0][1]])
But couldn't find anything in the csv file. How to fix it?