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