I have an ordered dictionary, and I'm trying to go through it in reverse order, mainly starting from the last (key, value).
dicts = OrderedDict()
...
for key, value in reversed(dicts.items()):
The above code works fine when I use PyCharm with Python 3.5.1, but when I put it in code games using their Python 3 interpreter (not sure which version), I get the following error to implement the for loop:
TypeError: argument to reversed() must be a sequence
Why is this error happening and how can I fix it?
source
share