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'])
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
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.
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.
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, 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])
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!!
Amazing explanation, very simple, and straigtht to the point.
Thank you so much was trying so much since some apis would give me lists of dicts i couldnt work with them you are goated.🐐🐐🐐🐐
Thank you for this video, you explained things no one else has explained. God bless
Thank you very kind
@@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
@@aicode2304Keep spreading the good word my friend! Jesus is the Way, the Truth and the Life! :)
Thats what i was looking for! Keep going with tutorials like that!!
OMG! Another Linux user! Hey bro! I use Linux too!
Thanks John!
This video has been very instructive to me!
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.
agree
Thanks for sharing again John!
Thanks, you just cleared up some confusion. Thank you!
well explained, will watch more of your videos for sure, cheers
Hi John, thank you for the video. It was very helpful.
Hey John, thanks for the video. What If I want to get all the elements of the same key name? For example, all values from ['size']? How could I do it?
Did you find an answer to that? Im trying to do the same now
@@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'])
@@rubao3000 Thanks it worked!
continue doing full python tutorial plz it will be very helpful !
Thank you John, great work, again
Excellent explanation. Really thankfull.
great bro, this is what I was looking for
Thank you so much for this video. It was helpful.
What do you do if you don't know the index or keys? Like when trying to autofill or auto grab data using a loop?
Do you have a video where you are making iteration over list of dicts and adding information from one list of dict to other?
U may use 'append' with the help of keys and values from a dictionary
thank you very much for the great video. I have a question. How do you get the index of an item in an array(the array that is a value in a dictionary)
nice tutorial it surprise a little more in comparison with othhers
Useful. You can also watch my playlist, Many useful and fundamental for Python crash course tutorial.
Can you show for example, when you enter a US state if will show the capital of that state?
Excellent video, very useful. Thank you.
thank you very much, it was very, very useful
Thank you for making this video
Glad it was helpful!
Thank you for this video. Very helpful!
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
Really helpful, thanks a lot!
Glad it helped!
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.
What if I just want to print all of the names? Not specifying the index, just the key. For example:
`print(products['name'])`
And get all the names?
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.
How do you access “itemid”: “1002” ?
Oh!. I got it!
products[1]
Don’t bother to answer
How can I call the whole list of dictionary
Backed me into a corner with that if it has lmk if it hasn't lmk
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
great video 👍😊
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])
thanks