Python 3 Programming Tutorial – Dictionaries




In this Python 3 programming tutorial, we cover Python dictionaries. Dictionaries are a data structure in Python that are very similar to associative arrays. They are unordered and contain “keys” and “values.” Each key is unique and the values can be just about anything.

Dictionaries are sets and they are defined with {} curly braces.

Sample code for this basics series:

Python 3 Programming tutorial Playlist:

Bitcoin donations: 1GV7srgR4NJx4vrk7avCmmVQQrqmv87ty6

source

39 thoughts on “Python 3 Programming Tutorial – Dictionaries”

  1. Anyone knows in which other tutorial he uses dict? I am doing a big database and could be helpful

    Thank you, great video

  2. Whats the python alternative to the "struct" structure used in Matlab? I need to store differently sized matrices and double variables. Its like a bin where you can store whatever you want

  3. Hey. I've got a problem with dictionaries and I need help. I'm probably being stupid but my scenario is this: I have a collection of lists, always with 5 values in them e.g. (["a","b",1,2,3],["b","c",2,3,4],["a","c",3,4,5]) and I need them to get into a dictionary so that it looks like {a:b,1,2,3},{b:c,2,3,4}… any ideas would be appreciated!

  4. When I try the last one:
    print(exDict['Jack'][1])
    I get an error like this: TypeError: 'int' object is not subscriptable
    Can anybody give me a clue about it?

  5. Hey, you have great tutorials! I learnt a lot from them. I wonder if you can do a tutorial —> Using user input to create dictionaries in Python using while loops? – This would be much appreciated. Keep up the good work!

  6. wtf why make it hard i know it's just one more code but they could have used some diversity in .remove and used that to remove something from the dictionary too it wouldn't have triggered me

  7. Say I was thinking of making a dictionary of people first would be a dictionary of tim that would hold age height weight and an image. then another dictionary of john to hold the values for him then another dictionary for jared and so on.
    would a dictionary be a good way to do this or would there be a better way. I think in java id just be creating a class would that be better for my example

Leave a Reply