- Where Developers Learn, Share, & Build Careers
I am trying to export This gives me this output, which includes 5 and 6 in What I should do is: data [1] In fact, data to CSV, where the data contains two lists of unequal items Length
import csv item_dictionary = {'13742': 'cat', '25037': 'dog'} name = item_dictionary.values () data = [[1, 2, 3] , 4, 5, 6], [7, 8, 9, 10]] export_data = zip (* data) myfile = open ('sample.csv', 'wb') wr = csv.writer (myfile) wr.writerow (Names) Wr.writerows (export_data) myfile.close () data [0] Is not done. >
dog To include all values of cat 1 7 2 data [0] , how can I modify my code to not be limited to the length ZIP prevents it to reach the end of the least movable. This is a function to use when you want to zip at the end of the long runner.
Comments
Post a Comment