Nice answer to a Python dictionary question

  • Context: Python 
  • Thread starter Thread starter scottdave
  • Start date Start date
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 617 views
So here is what I think a pretty nice explanation to a Python dictionary question. https://www.physicsforums.com/threads/creating-a-new-dictionary.987207/#post-6326948
@Nick-stg sounded concerned that he might be giving too much information. While there is a lot of info in his post, it isn't really giving away an "answer". The OP should have a better understanding how Python dictionaries, to be able to derive a solution on his own.
 
  • Like
Likes   Reactions: berkeman and jedishrfu
Physics news on Phys.org
scottdave said:
here is what I think a pretty nice explanation to a Python dictionary question

While the post does give some good general information about Python dictionaries (although one of the snippets of code has an error), it's general information that the OP of the thread already has--his code snippet makes it clear that he knows how to iterate over a dict and how to check for the existence of a key. The post by Nick-stg does not address the specific question the OP of the thread was asking. Your post, @scottdave, does that.