Dictionaries in Python - Advanced Python 03 - Programming Tutorial

preview_player
Показать описание
In this Python Advanced Tutorial we will be learning about Dictionaries in Python. A Dictionary is a collection data type that is unordered and mutable. It consists of a collection of key-value pairs. Each key-value pair maps the key to its associated value. We will go over how you can use them and some advanced techniques that can be applied to dictionaries.

~~~~~~~~~~~~~~ GREAT PLUGINS FOR YOUR CODE EDITOR ~~~~~~~~~~~~~~

📚 Get my FREE NumPy Handbook:

📓 Notebooks available on Patreon:

A written Tutorial can be found here:

You can find me here:

#Python

----------------------------------------------------------------------------------------------------------
* This is a sponsored or an affiliate link. By clicking on it you will not have any additional costs, instead you will support me and my project. Thank you so much for the support! 🙏
Рекомендации по теме
Комментарии
Автор

you explore parts of topics that a lot of others do not.
much appreciations for that

LA-cyzj
Автор

Kudos to you, the way you applied this tutorial helped me understand how the other concept works as well.

THANK YOU!

Crisrtiz
Автор

This is a great series to speed through for my upcoming interview!

fuehnix
Автор

The t is sometimes missing in mydict...

Eagler
Автор

you wrap up on everything, you are a legend

abdullahassaf
Автор

V easy to understand and well explained videos

tanuj
Автор

for those new to this topic like me

in the example 'USA': 'Washington DC' - USA is the key and Washington DC is the value

May seem obvious but realising this made me understand this easier and hopefully you too

LA-cyzj
Автор

Excellent video
Now I think I can deal with Dict:

my_dict = {"content": something, "length": None}
instance = my_dict.pop("content")
my_dict["length"] = scan(instance, in="cm")
if my_dict["length"] > 12:
yup()
else:
nope()

harudot
Автор

I was listening to this one my speakers at max volume and just kept hearing mydi**

borki
Автор

Sir very nice video. I have one question, how to print specific key value in a dictionary. Without entering its name in code. We should get the output as - Enter the product name ( some key)
- it's value should come as output. Please help me sir.

akshathat
Автор

Thanks for this wonderful video, you explained a very simple way. I have one query related to a python dictionary is it possible we can store excel data into a python dictionary and perform some CRUD operation on it.

Ajitshukla
Автор

Im just starting to learn Python. I just wanted you to know how insightful and helpful your videos are. I have a question - I have a large file of data organized in alphabetical order. what is an efficient way to parse out ONLY USA data. the file is a .txt file. any comments would be appreciated, I will continue with your site thank you

gabrielcohen
Автор

Hi, I just started coding and I was wondering what platform you're using for your code. I've been coding through IDLE but it's a lot less easier to create big functions and see the outputs clearly, so I was just wondering

andrewhli
Автор

So when I use popitem() it returns me the key and value of that dictionary( which was under curly braces { } ) as a tuple ( (... ...) ). May I please know what is the reason behind it or it is by definition/ trivial

Thanks for the great video content!

Narennmallya
Автор

Hello, I'm recently starting using VS Code for my python projects, how are you able to run the code on the output section without running the whole file address, I'm having trouble on that. Thank you.

empty_dayofthetech
Автор

Can you add a key to a dictionary with multiple values AND multiple value types? i.e. "Variable1": "MyName", 14, [A, B, C]
Awesome tutorial!

ignacioleikis
Автор

I have a table and I want to assign my keys as a Table Headers. Table has 50 columns (keys) and 100 rows.

irinastlouis
Автор

a little trick: reverse dictionary's key and value

mydict = dict(a=0, b=1, c=2)
print(mydict)
reversed_mydict = {v:k for k, v in mydict.items()}
print(reversed_mydict)

{'a': 0, 'b': 1, 'c': 2}
{0: 'a', 1: 'b', 2: 'c'}


Use with caution. When you have same value in the dictionary, the reversed dictionary's value may be overwritten.
mydict = dict(a=0, b=1, c=1) # both b and c have the same value 1
print(mydict)
reversed_mydict = {v:k for k, v in mydict.items()}
print(reversed_mydict)

{'a': 0, 'b': 1, 'c': 1}
{0: 'a', 1: 'c'}

wenyange
Автор

This guy loving talking about his dict

benhighum
Автор

how to add a element at particular index?

srinivasnagulapally