re: Python for JavaScript Developers VIEW POST

TOP OF THREAD FULL DISCUSSION
re: But note that in python for key in {1: 10, 2: 20}: iterates over dictionary's keys. You can use for value in d.keys():, for (key, value) in d.item...

You can drop the parenthesis i.e. for k, v in thing.items(). You only need parenthesis for comprehension i.e. {k: v for (k,v) in thing.items()} or [(k,v) for (k,v) in thing.items()]

code of conduct - report abuse