filmov
tv
Python Tutorial: Dictionary in Python

Показать описание
#region Notes
"""
Mutable
ordered Sequence
Heterogenous items
Key-Value pair
Accessed by Key
Key should be Unique
"""
#endregion
data={
1: "one",
'2': [2, "Two"],
3 : {
3.1 : True,
3.2 : (1,2,3)
}
}
#region crud
data[2]=2
# print(data)
data[2]="Two"
# print(data)
#endregion
# if key == 3:
# print("Nested dictionary")
# else:
# print(f"{key} = {value}")
"""
Mutable
ordered Sequence
Heterogenous items
Key-Value pair
Accessed by Key
Key should be Unique
"""
#endregion
data={
1: "one",
'2': [2, "Two"],
3 : {
3.1 : True,
3.2 : (1,2,3)
}
}
#region crud
data[2]=2
# print(data)
data[2]="Two"
# print(data)
#endregion
# if key == 3:
# print("Nested dictionary")
# else:
# print(f"{key} = {value}")