Hello, in this video, we'll go over the assignments of dictionary practice basic and let's begin.
Let's go over the assignments quickly.
All right.
So first of all, please create a dictionary about Alex.
Alex is 32 years old.
He's married and he has three kids up towards his extract, all values of dictionary, and assign them
into simple variables.
And please choose variable time according to values type of input, meaning like values here.
I'm not going to say which ones are strengths, which ones are integers.
Uh, if you came until this point, you probably know, uh, which one is who.
So just create three variables and assign them assign the values as we did and the previous video.
All right.
Uh, now we have assignment number three, which is a challenge.
And it's also a search Google assignment.
As I always mention, once you become automation developers, you will have to use Google as your best
friend.
And each time you don't know something, you will go there to look for it.
So I will help you with this challenging assignment and also recommended you to search and Google with
this phrase python update value of dictionary.
And we will go over and do it right now.
And as you can see, I already search for it.
All right.
So it's right here.
And let's head over for the first website w w w that program, News.com, uh, seems like a decent website,
which I use from time to time.
So once we go here, you see here the syntax of update, there is like an action called update and you
put a dictionary inside so you see your square brackets inside the update, meaning inside the square
brackets.
We can only have a dictionary item.
All right.
But it says other here.
Hmm.
All right.
Let's go a little further and let's head out for an example.
OK, so we have two dictionaries here, Dictionary D, which has the key one and the value one in string.
And then it has the key to and it has the value three.
So this is basically an error, I guess.
So afterwards we have another dictionary called Daewon and we have a key of two and value of two.
So I assume that this is the correct key and value and let's see what they're doing here.
They're taking the first dictionary, which is this one taking it and then placing here, placing him
with that update.
Yeah.
And then they're just placing the name of the second dictionary.
So I assume that once we print it.
All right.
So the place of key to like the key and value here is two and two.
So this item will replace replace this item because there are matching and also this value would replace
this value.
So this way we could update a value inside a dictionary.
Let's see the output.
So we have here we have here one and then we have key to add value to.
So this is the first print.
So this is exactly what they did here.
They took this dictionary, all right.
They placed it here inside the dart update and they did it upon the first dictionary.
So they basically updated the dictionary with these key and value in the placement where you can see
the same key.
OK, by the way, all the right, for this example, are reserved to programming's dot com.
OK, so we have a clue how to update it.
And also, if you get into trouble, scroll down to the beach.
Two of this document there, you will find the answer.
But don't be tempted to do it really fast.
Just try to resolve it by yourself and try to fight with the code and try to make your results come
from you first.
Only if you get stuck, go there and see the resolution.
All right.
So it's not actually the resolution is the way of solving it.
All right.
So the first the fourth assignment says Alex had a birthday and not.
Now, yeah, now is 33 day the value that belongs to the key age.
So basically update this cell of age, updated to 33, applying what we learned and saw it right here.
And once Alex became 33, a little girl joins his family, update the kids key value into four.
So this is the same as we did an assignment number four and last two assignments.
Just print out the value of the dictionary, the values of the dictionary, and then print out the keys
of the dictionary.
OK, so that's about it.
I wish you good luck resolving these assignments and I will see you in the next video with these assignments
resolution.
Thank you.