Data Types in Python - Mapping Types - dict - Madhu Sir | Leela Soft

Опубликовано: 05 Май 2026
на канале: Leela Soft
271
44

#dict #leelasoft #python #dicttype
Mapping Types in Python:
1. A mapping object maps hashable values to arbitrary objects.
2. Mappings are mutable
3. There is only one standard mapping type, the dictionary (dict)

Creation of dict:
1. by using {} #empty dictionary
2. by using {10:"Java", 20:"Python"}
3. by using dict() #empty dictionary
4. by using dict(**kwarg)

l = [("Java", 20), ("Python", 30), ("Python", 40)]
dict(l)

Mutable and Immutable:
Mutable:
bytearray
list
set
dict
Immutable:
int
float
complex
bool
str
tuple
bytes
frozenset


None Type:
def m1():
pass

m1()
x = m1()