Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • sometimes the key's corresponding value(s) are expected to also be used somewhere further in the code, which dict.items() returns a list of its (key, value) tuple pairs. However, if you don't need the values, then dict.keys() function can be (and often is) used. Which function you use may just depend on your needs/requirements. Commented Mar 4, 2019 at 19:58
  • 1
    Must have clicked twice :( Commented Mar 4, 2019 at 22:53