I made a dictionary, then split up the values and keys into lists and now its looks like this:
keys = [(4,5),(5,6),(4,8)......so on].
values = [('west',1),('south',1).......]
Then I made a new dictionary like in this way,
final = dict((k,v[0]) for k,v in zip(keys, values))
When I execute -print final - output is in this form... {(4,5):west,(5,6):south,......so on}
Now i need to have the value of key (4,5)...it can be any key..
q:2
win = gap.pop() - here gap is a stack
print win - the output is (1,1)
return final.get(win) -
but when I do this return, it gives me an error and final is the directory that I have made with lists of keys and values
The error is: 'W'