I am new in python. In my python script I want to export data to CSV file. What i did i have created a number.csv file in the folder where my python script is. I am using python 3.6.6. I have tried too many examples, but none of is working. Here is my code :
import csv
nms = [[1, 2, 3, 4, 5, 6], [7, 8, 9, 10, 11, 12]]
with open('number.csv', 'w',newline='') as f:
writer = csv.writer(f)
for row in nms:
writer.writerow(row)
newline=''in theopen) containing two rows of data. What happens instead for you?