# Dict (mutable): "key:val"
# key (immutable): int, float, bool, str, tuple
dict1 = { 'id':10, 'age':20, 11:'hello', 0.5:30.5, ('hello',3):[10,20] }
print(type(dict1), len(dict1), dict1)
print( dict1[11], dict1['id'], dict1[('hello',3)] )
dict1['id'] = 12345
print(dict1)
return_val = dict1.pop('age')
print(dict1)
dict1['gender'] = 'F'
print(dict1)







0 ความคิดเห็น:
แสดงความคิดเห็น