ordered_list = [ "Mon","Tue","Wed","Thu","Fri","Sat","Sun"]
wb = Workbook('dem.xlsx')
ws = wb.add_worksheet("New Sheet")
first_row=0
for header in ordered_list:
col=ordered_list.index(header)
ws.write(first_row,col,header)
col=1
for j in po:
row=ordered_list.index(j[0])
ws.write(col,row,j[1])
col+=1
wb.close()
I have list po = [('Mon', 6421), ('Tue', 6412), ('Wed', 12416), ('Thu', 23483), ('Fri', 8978), ('Sat', 7657), ('Sun', 6555)]. I have to print this list in Excel Sheet like
mon 6421
Tue 6412
wed 12416
'''
'''
Sun 6555
But I am getting like this. Can anyone help me to solve this.
Mon Tue Wed Thu Fri Sat Sun
6421
6412
12416
23483
8978
7657
6555