0
dictionary
def, I don't get this part
6 Respostas
+ 4
dictionaries are in key and values pairs and it do not have any indexes. It can be integer, strings, float anything
{
'key':value,
'key':value
}
Ex:
{
'ball':46,
'cricket':34,
}
+ 3
Unknowns ,
your statement that any data type can be used in dictionaries can mislead readers.
a *key* must be hashable, that means:
> a keys must be an *immutable data type*.
we cannot use data types as a key that can change after they are created like:
> list, dictionary, set
*values* can be of any data type
+ 1
In What language? Python, C#, ...
+ 1
Lothar I never mentioned keys to be of any data type and thanks for clarifying in detail
0
def is a pre defined keyword in Python used for creating a function that can be used whenever required.
Ex:-
def add():
a=4
b=5
print(a+b)
add()
0
I'd like to invite you to join our vibrant community of programmers on WhatsApp!
Our group is dedicated to helping each other with coding challenges, sharing knowledge, and learning from industry experts. Whether you're a beginner or an experienced developer, you'll find valuable resources, support, and camaraderie here.
Join us to:
- Get help with coding problems and challenges
- Share your expertise and learn from others
- Stay updated on the latest programming trends and technologies
- Connect with like-minded developers and build meaningful relationships
Click this link to join our community
https://chat.whatsapp.com/FW0nBbr3Eug3oTiL1U53gR
Looking forward to coding, learning, and growing with you!"



