Good day ! I am having some trouble comparing values inside lists that are inside a dictionary.
{'lst_4':['New York', 'Amsterdam', 'Berlin'],'lst_5':['New York', 'Brussels',
Rome'],'lst_6':['Helsinki', 'Stockholm', Milan']}
The final goal is to compare the first item in each list, if they match I want to print which one it was. However I am having trouble comparing them because of the dict/listception.
My code so far:
x = 0
dct = {}
for row_cells in sheet.iter_rows(min_row=1, max_row=20):
x += 1
dct['lst_%s' %x] = []
for cell in row_cells:
if cell.value == None:
break
else:
dct['lst_%s' %x].append(cell.value)
print("-------------------------------------------------")
if not dct['lst_%s' %x]:
break
zin = dct['lst_%s' %x][0:]
print(zin)
Any help, or pointers are much appreciated.
Cheers,