+ 2
Am stack on tuples . Can anyone help me ?
Am not understanding collection data types please someone help me . Mostly dictionaries and sets.
5 odpowiedzi
+ 4
Can you be a bit more precise about what it is you're struggling with? to say "not understanding" didn't come as clear on the "which" part ...
+ 4
Dictionaries
+ 2
It's intermediate python so, help me and upvote my question I really need help
+ 2
Please post complete question. You can learn collection data types by solving more problems using these data types.
+ 2
Well, you can think of it like a real life dictionary. A dictionary item contains of a pair of key and value. In real life dictionary, let's assume an English ~ German dictionary, the keys are words in English, and the values are the respective translation in German.
In real life dictionary we search a word by looking at the markers (marked with letters usually). In programming, the technique is so called "hashing", a way to convert the key to a form that can be searched quickly (technical details are far beyond my league).
A dictionary's item key is unique, but an item's value may not be. That means if you add a new item having a key whose value can be translated equal to an existing item, the existing item value will be overwritten by the new value, but the key remains.
I hope you now get a rough idea of it. If you have another doubt more specific to dictionary, you are welcome to ask.