I have coordinates as keys in dict and want to read them like a normal list when I try to extract them. See example:
testlist = {'[0, 0]': 0, '[1 ,1]': 1}
for tmp in testlist:
if testlist[tmp] == 1:
print(tmp[0], tmp[1])
The above example should return
1 1
However it outputs
[ 1
I tried list(tmp)
and tmp.split()
but neither gave the desired output. There probably exists an easy solution, but I could not find it yet.