Skip to playerSkip to main contentSkip to footer
  • 5/18/2025
In Python, a dictionary stores data as key-value pairs. Each key within a dictionary must be unique and immutable, meaning it cannot be changed after it's created. Common data types used for keys include strings, numbers, and tuples
Transcript
00:00There is a small concept that I had to iterate on the definition, but I thought that you can clear that the dictionary's keys are immutable.
00:12The immutable data types of data types, you can replace them.
00:18For example, string is a immutable data type.
00:23You can replace it.
00:33This is a single pair of dictionary.
00:38You can replace it.
00:44If I run it, it's quite happy.
00:47The key is immutable.
00:57The key is immutable.
01:00The immutable data type is false.
01:04We have false.
01:06We see false.
01:09Nice.
01:10However, one thing we have noted is that the list is mutable.
01:15It is immutable.
01:16We have indexing and change the value.
01:19The list is equal to 1, 2, 3.
01:26One, two, three.
01:27So, I would say that the list of index is zero.
01:33I would not assign value to 2.
01:36I would say that.
01:37How was it possible?
01:39The list is immutable.
01:41I would say that the string is immutable.
01:45Basically, the dictionary is the key is immutable.
01:50Now, because the list is immutable,
01:52you can say that one of this list is equal to this thing.
01:57Now, I will run it.
01:59It's mad on me.
02:00Okay.
02:01It's a unhashable type.
02:05You cannot add this thing.
02:07Okay.
02:08Interesting.
02:09So, you can use any key, any data type except which is mutable.
02:19Which is mutable.
02:20The change is not.
02:21Okay.
02:22A small thing is to have to use which type is best.
02:29Of course, you will know what experience is.
02:32Which type is best.
02:36Imagine you have to develop a game.
02:38Now, we're in game today we have a player of country╪з╪┤ita save.
02:46We're in this new movement,
02:47We,...
02:48Now, we have the list node the circle which я┐╜ client.
02:50You can use characteristics...
02:51Characteristics.
02:52Ok.
02:53Carestan is ...
02:54Characteristics...
02:55╫Р...
02:57Characteristics.
02:58And ...
02:59Characteristics is a name to have a group.
03:01Let's call...
03:02Let's say power,
03:05let's say power
03:07рдареАрдХ рд╣реИ рдФрд░ рдЙрд╕рдХреЗ рдкрд╛рд╕
03:09let's say bonus рд╣реИ
03:11and so on
03:13however
03:14this is not
03:18the property
03:19is not the property рддрд░реАрдХрд╛ exist
03:21рдХрд░рддрд╛ рд╣реИ рдФрд░ рд╡реЛ
03:22basically рдЗрд╕рдХреЛ dictionary рдореЗрдВ рдЖрдк define рдХрд░ рд╕рдХрддреЗ рд╣реИ
03:25рддреЛ рдЖрдк рдХрд╣реЗрдВ dictionary
03:26рдареАрдХ рд╣реИ is equal to
03:28рдПрдХ рдирдИ dictionary рдЖрдк define рдХрд░рдиреЗ рд▓рдЧрд╛ рд╣реИ
03:30рдЙрд╕рдХреА рдЦрд╛рд╕рд┐рдд рдпрд╣ рд╣реИ
03:33рдХрд┐ рдЖрдк рдЙрд╕рдореЗрдВ рдХрд╣рддреЗ рд╣реИрдВ player
03:34рдареАрдХ рд╣реИ, key is equal to, рдЕрдм рдЬрд░рд╛ рдЖрдкрдиреЗ рдЧрд╡рд░ рдХрд░рдирд╛ рд╣реИ, player, рдФрд░ player рдХрд░рдиреЗ рд╣реИрдВ, let's say, john, рдпрд╛ name, рдареАрдХ рд╣реИ, рдЙрд╕рдХреЗ рд╕рд╛рде, power,
03:52full, рдЕрдм рджреЗрдЦрд┐рдП, рдпрд╣ рдордЬрд╝реАрдж descriptive рд╣реЛ рдЧрдпрд╛ рди, рдЕрдм рдореИрдВ, for example, рдореИрдВ рдХрд╣рддрд╛ рд╣реВрдБ, bonus, рдареАрдХ рд╣реИ,
04:08two lives, рдЕрдм рдордЬрд╝реАрдж descriptive рд╣реЛ рдЧрдпрд╛ рди, рдФрд░ рдЕрдм рдореИрдВ easily, рдЬрдм рднреА dictionary рдХреА player рдХреЗ, let's say, power call рдХрд░реВрдВрдЧрд╛,
04:21рддреЛ рдореБрдЭреЗ рдЙрд╕рдХрд╛ status рджреЗрдЧрд╛, рдХрд╣реЗрдЧрд╛ powerful, рдЕрдЬреА, however, рдЬреЛ list рд╣реИ, рдЙрд╕рдХреЗ рдЕрдВрджрд░ рдпрд╣ рдРрд╕рд╛ descriptive рдирд╣реАрдВ рд╣реИ,
04:30рдпрд╣ рдПрдХ рдЫреЛрдЯреА рд╕реА example рджрд┐рдпрд╛ рд╣реИ, рдХрд┐ рдХреМрди рд╕реА application рдХреЗ рд▓рд┐рдП рдХреМрди рд╕рд╛ data structure рдмрд╣рддрд░ рд╣реИ,
04:35рддреЛ рдЖрдкрдиреЗ рдЗрд╕ рдмрд╛рдд рд╕реЗ, рдЗрд╕ рдЕрд╡рд╛рд▓реЗ рд╕реЗ mindful рд░рд╣рдирд╛ рд╣реИ, рдХрд┐ list рд╣реЛ, рдпрд╣ dictionaries рд╣реЛ, рдпрд╣ application specific рд╣реИ,
04:44рдпрд╣ рдРрд╕рд╛ рдирд╣реАрдВ рд╣реИ, рдХрд┐ dictionary рдЕрдЪреНрдЫреА рд╣реЛрддреА рд╣реИ list рд╕реЗ, рдФрд░ list рдЕрдЪреНрдЫреА рд╣реЛрддреА рд╣реИ dictionary рд╕реЗ,
04:49рдХреЛрдИ list рдорд╛рд░реА, рдХреЛрдИ list рдХреЗ рд╕рд╛рде, рдпрд╣ рддреЛ рдирд╣реАрдВ рд╣реИ, рдХреЛ personal friendship рд╣реИ,
04:54basically, рдЕрдЧрд░ рд╣рдордиреЗ рдПрдХ data structure рдХреЛ preference рджреЗрдиреА рд╣реИ, on the other data structure, as a developer,
05:01рддреЛ рд╣рдореЗрдВ рдкрддрд╛ рд╣реЛрдирд╛ рдЪрд╛рд╣рд┐рдП, рдХрд┐ рдпрд╣ list application рдХреЗ рд▓рд┐рдП suitable рд╣реИ, рдареАрдХ рд╣реИ рди, рддреЛ рдЗрд╕ рдмрд╛рдд рдХрд╛ рджрд┐рдпрд╛рди рд░рдЦрдиреЗ,

Recommended