Python 3 Programming Tutorial | #9 Accessing Dictionary key and value using map & lambda function

preview_player
Показать описание
In this python 3 programming tutorial, I have talked about how you can access a dictionary key and value using lambda expression and map function.

#DataScienceWithPython #DataScienceWithR #DataScienceCourse #DataScience #DataScientist #BusinessAnalytics #MachineLearning #PythonProgramming #PythonTutorial #lambdafunction

Practical,machine,learning,Python,Tutorials,python 3 programming tutorial,python dictionary tutorial,getting a specific python dictionary key and value,Accessing Dictionary key and value using map & lambda expression,python dictionary data access,python dictionary key access,python dictionary value access,python lambda expression,python lambda expressions tutorial,learn python programming for beginners,python dictionary manipulation,python lambda and anonymous function
Рекомендации по теме
Комментарии
Автор

both examples are accessing values, not keys. 'country' and 'sales' are both keys. "India" and 150.5 for example, are the values of the first dictionary in your list
{key: value, key: value, key: value} etc.

jacobthomas
Автор

Is there are reason why you would construct the dictionary as a list of dicts in the first place?
Why isn't it just:
>> sales = {'India':'150, 'China':200, 'etc':42}
?

NolanZewariligon
Автор

For future generations of coders:
sales = [{'country': "India", 'sale': 150.5}, {'country': "China", 'sale': 200.2}, {'country': "US", 'sale': 300.3}, {'country': "UK", 'sale': 210.4} ]

RR-hqcv