thanks I have made a new list from data on the previous code.
and I can reach the perfect results. except an extra empty line at the end. which I dont know how to remove it.
and I can reach the perfect results. except an extra empty line at the end. which I dont know how to remove it.
Quote:data= ['Daniel', '5104', 'elham', '9770']
dataf=([data[i:i+2] for i in range(0, len(data), 2)])and here is my output on the csv file. I have used below code to write on the csv file.
with open(output_file_name, 'w', newline='') as output_handler: writer = csv.writer(output_handler) writer.writerows(dataf) output_handler.close()and the output is:
Quote:danial,5104
elham,9770
####I receive an empty line here !!!