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
0:15
Smart putty hack for cement work
MetDaan Creative
2 days ago
3:03
These hacks really work
MetDaan Creative
3 days ago
0:56
How to easily cut fruit! ЁЯЩМ
MetDaan Creative
4 days ago
11:34
Power BI Magic: Easy 30-Day Sales Calculations Made Simple
expertiseexcelerate
7/7/2025
13:41
Discover Power BI Desktop's Hidden Scenario Analysis Secrets!
expertiseexcelerate
7/7/2025
7:40
Mera Mazloom Hussain | Nadeem Sarwar 2020 | 1442
Gham-e-Hussain | ╪║┘Е┘Р ╪н╪│█М┘Ж╪С
6/9/2025
13:27
Time Intelligence PROBLEMS SOLVED?
expertiseexcelerate
1/7/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