DEV Community

Discussion on: Data Structures in Python: Dictionaries

Collapse
 
georgeoffley profile image
George Offley • Edited

I updated the enumeration section. Thanks a lot for your input. On the rest the print() method is usually my tip off on Python2 or 3. While I understand that there can be confusion, anything made in the last year or so should be in Python 3. Anything I write is in Python3 and tested in Python3.

The rest is really style, and there's no substance in writing out adding entries to a dictionary one way or the other. I will say that not repeating yourself is a golden rule in programming. However, for this purpose it doesn't matter.

Finally the get function is only rare if I use it rarely. Unless there is a specific performance issue with using that particular function, I don't think it matters. Thanks for the input, though.