Thank you so much man! My school taught us about basics of dictionaries (without list of dicts) and there are lists of dicts included in assignment and they expects us do complete it. luckily there is this vid!!
@@JohnWatsonRooney also, i know this sounds really random, but im asking people if they believe in an afterlife or in God. I dont want to take too much time away from you though
Nothing wrong with this video, well explained, very clear. In addition to this, it would be great to see a video how to get data into a collection of lists, dictionaries or combination of those instead of starting with a given collection. There are very few videos about that and as a beginner that is really a challenge once you try to get out of the tutorials and try building your own stuff.
@@Riyoshi000 Hey, man. I don't remember how I figured it out, but this may help you: products = [ {'name': 'shirt', 'size': 'M', 'price': 25.0}, {'name': 'pants', 'size': 'L', 'price': 45.0}, {'name': 'shoes', 'size': 10, 'price': 25.0}, {'name': 'shirt', 'size': 'M', 'price': 30.0} ] for i in products: print(i['size'])
It is not complicate, people make the concept complicated, by talking too much. Teaching coding is about practicing not showing off what you understand about the topic.
I have an issue that I can't seem to find anywhere. I have a dictionary with lists in it. All keys have multiple values which are integers how can I get the sum of each values in a specific key?
Hi - a dictionary key is a single value, not sure what you mean exactly. but you can get all the keys from a dictionary using yourdict.keys(). this will return a list of all the key values
user = input( something ) user1 = input( 1 ) user2 = input( 2 ) output = dict = { 'something' : { '1':'1'}, 'something2' : { '2':'2'}} how can i create something like that? that user can self input as many as he wants nested lists
Hi mate, at the end of the video How do I print only all the 'color' key? I mean: if I had a large list of dictionaires I can't type always the index and then the key, instead, I would print only all the 'color' keys because I want to know all the colors are in. I hope its clear enough, thanks in andvance
I'm new to python so take the suggestion with a pinch of salt, but I think you could use a for loop like this: for x in product: print(product[x][colour]) This should loop through all the dictionaries in the list, and for each one, print the colours available.
Hi, I ask you to write, which index access only 'Peti' or 'Zsolt' in my list. Thank you. project_d=[ {'Y':{'name':'Zsolt'}}, {'X':{'name':'Peti'}}, {'V':{'name':'Zsolt'}} ] for i in range(len(project_d)): print (project_d[i])