[Revision] Methods_python
[Revision] Methods_python
Dictionary
Methods
• Clear()
• Copy()
• Get()
• Items()
• Keys()
python
• Popitem() ,.
Diet • Values()
• Pop()
• Update()
• Setdefault()
clear()
The clear() method removes all items from
the dictionary.
pr1nt (new_d1ct)
get()
The get() method returns the value of the
specified key. If the key is not present in the
dictionary, it will return None
pri.nt (occupati.on)
items()
The items() method returns a list of
key-value pairs in the dictionary.
.................................................................. ,
setdefault()
The setdefault{) method returns the value
of the specified key
Utsav Desai
Full Stack Developer
@utsavdesal26