Suppose there is a list: ['1604780184', '10', '1604780194', '0', '1604780319', '99', '1604780320', '0']
You need to get a result like: {'1604780184': '10', '1604780194': '0', '1604780319': '99', '1604780320': '0'}
Now I have so:
rline = ['1604780184', '10', '1604780194', '0', '1604780319', '99', '1604780320', '0']
total = {}
print(f"My list: {rline}")
while rline:
total[rline[0:2][0]] = rline[0:2][1]
del rline[0:2]
print(f"Dictionary: {total}")
Please advise a better way. Thanks.