Skip to player
Skip to main content
Skip to footer
Search
Connect
Watch fullscreen
Like
Comments
Bookmark
Share
Add to Playlist
Report
Lecture 43: Python has Un-changeable dic key
Nafees AI Lab
Follow
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
Category
๐
Learning
Transcript
Display full video transcript
00:00
There 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:12
The immutable data types of data types, you can replace them.
00:18
For example, string is a immutable data type.
00:23
You can replace it.
00:33
This is a single pair of dictionary.
00:38
You can replace it.
00:44
If I run it, it's quite happy.
00:47
The key is immutable.
00:57
The key is immutable.
01:00
The immutable data type is false.
01:04
We have false.
01:06
We see false.
01:09
Nice.
01:10
However, one thing we have noted is that the list is mutable.
01:15
It is immutable.
01:16
We have indexing and change the value.
01:19
The list is equal to 1, 2, 3.
01:26
One, two, three.
01:27
So, I would say that the list of index is zero.
01:33
I would not assign value to 2.
01:36
I would say that.
01:37
How was it possible?
01:39
The list is immutable.
01:41
I would say that the string is immutable.
01:45
Basically, the dictionary is the key is immutable.
01:50
Now, because the list is immutable,
01:52
you can say that one of this list is equal to this thing.
01:57
Now, I will run it.
01:59
It's mad on me.
02:00
Okay.
02:01
It's a unhashable type.
02:05
You cannot add this thing.
02:07
Okay.
02:08
Interesting.
02:09
So, you can use any key, any data type except which is mutable.
02:19
Which is mutable.
02:20
The change is not.
02:21
Okay.
02:22
A small thing is to have to use which type is best.
02:29
Of course, you will know what experience is.
02:32
Which type is best.
02:36
Imagine you have to develop a game.
02:38
Now, we're in game today we have a player of countryุงุดita save.
02:46
We're in this new movement,
02:47
We,...
02:48
Now, we have the list node the circle which ๏ฟฝ client.
02:50
You can use characteristics...
02:51
Characteristics.
02:52
Ok.
02:53
Carestan is ...
02:54
Characteristics...
02:55
ื...
02:57
Characteristics.
02:58
And ...
02:59
Characteristics is a name to have a group.
03:01
Let's call...
03:02
Let's say power,
03:05
let's say power
03:07
เค เฅเค เคนเฅ เคเคฐ เคเคธเคเฅ เคชเคพเคธ
03:09
let's say bonus เคนเฅ
03:11
and so on
03:13
however
03:14
this is not
03:18
the property
03:19
is not the property เคคเคฐเฅเคเคพ exist
03:21
เคเคฐเคคเคพ เคนเฅ เคเคฐ เคตเฅ
03:22
basically เคเคธเคเฅ 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:52
full, เค เคฌ เคฆเฅเคเคฟเค, เคฏเคน เคฎเคเคผเฅเคฆ descriptive เคนเฅ เคเคฏเคพ เคจ, เค เคฌ เคฎเฅเค, for example, เคฎเฅเค เคเคนเคคเคพ เคนเฅเค, bonus, เค เฅเค เคนเฅ,
04:08
two 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:54
basically, เค เคเคฐ เคนเคฎเคจเฅ เคเค data structure เคเฅ preference เคฆเฅเคจเฅ เคนเฅ, on the other data structure, as a developer,
05:01
เคคเฅ เคนเคฎเฅเค เคชเคคเคพ เคนเฅเคจเคพ เคเคพเคนเคฟเค, เคเคฟ เคฏเคน list application เคเฅ เคฒเคฟเค suitable เคนเฅ, เค เฅเค เคนเฅ เคจ, เคคเฅ เคเคธ เคฌเคพเคค เคเคพ เคฆเคฟเคฏเคพเคจ เคฐเคเคจเฅ,
Recommended
8:48
|
Up next
Lecture 42: Dictionary in Python Language
Nafees AI Lab
5/18/2025
7:51
Lecture 44: Most Used Dictionary Methods in Python
Nafees AI Lab
5/18/2025
9:15
Lecture 45: Tuple Data Types in Python
Nafees AI Lab
5/18/2025
11:19
Lecture 53: Python has for loop and Iterables
Nafees AI Lab
5/20/2025
9:59
Lecture 37: Python has Data Structor and Lists-II
Nafees AI Lab
5/17/2025
8:19
Lecture 36: Python has Data Structor and Lists
Nafees AI Lab
5/17/2025
8:22
Lecture 46: Set Data Types in Python
Nafees AI Lab
5/18/2025
4:57
Lecture 29: Type Conversion in Python
Nafees AI Lab
5/15/2025
3:23
Lecture 79: Sets and Dictionary Comprehension in Python
Nafees AI Lab
5/23/2025
4:03
Lecture 76: Python has Special Function Zip
Nafees AI Lab
5/23/2025
12:23
Dictionary in Python
Top news
9/5/2022
10:23
Lecture 78: List Comprehension in Python
Nafees AI Lab
5/23/2025
6:49
Lecture 74: Python has Special Function Map
Nafees AI Lab
5/23/2025
4:52
#13 Python Tutorial for Beginners // Swap 2 Variables in Python
Top news
9/5/2022
4:52
Lecture 50: Python with Boolean values
Nafees AI Lab
5/18/2025
3:41
Lecture 32: Python is Immutable
Nafees AI Lab
5/16/2025
9:38
Episode 1 โ The Curious Boy from Ulm (1879-1895)
Nafees AI Lab
6/8/2025
0:37
Top Fully Funded Scholarships in Germany 2025 ๐ฉ๐ช | Apply Now!
Nafees AI Lab
6/3/2025
0:25
The Boy and the Dragon โ โA Friend in the Skyโ
Nafees AI Lab
6/3/2025
1:03
Why Do Rainbows Appear? ๐ | Physics in Everyday Life
Nafees AI Lab
6/3/2025
0:28
Albert Einstein: The Genius Who Changed Time
Nafees AI Lab
6/1/2025
0:40
Stephen Hawkingโs Life in 60 Seconds: From Wheelchair to the Universe
Nafees AI Lab
6/1/2025
0:36
The Forgotten Night Hitler Was Nearly Killed
Nafees AI Lab
5/29/2025
0:31
Dilip Kumar โ The Tragedy King of Bollywood
Nafees AI Lab
5/29/2025
0:45
Marlon Brando โ The Rebel Who Redefined Acting | Nafees AI Lab
Nafees AI Lab
5/29/2025