ตัวอย่างการใช้เมธอด:
Python
person = {'name': 'John', 'age': 30, 'city': 'New York'}
print(person.keys()) # dict_keys(['name', 'age', 'city'])
print(person.values()) # dict_values(['John', 30, 'New York'])
print(person.items()) # dict_items([('name', 'John'), ('age', 30), ('city', 'New York')])
print(person.get('age')) # 30
print(person.get('phone')) # None
print(person.get('phone', 'N/A')) # N/A
person.update({'phone': '123-456-7890'})
print(person) # {'name': 'John', 'age': 30, 'city': 'New York', 'phone': '123-456-7890'}