len (x_dict)
To know the number of key: value pairs in the dictionary.

x_dict.keys ( )
Returns all the 'keys' of dictionaries

x_dict.values ( )
Returns all the 'values' of dictionaries

The del statement
It is used for deleting any keys from the dictionary.

x_dict.pop (key)
It will pop a 'value' of the required key.

sorted (x_dict)
The dictionary will get sorted by its values.

x_dict.clear ()
Clears all the content of the dictionary

最后编辑:2025年06月16日 ©著作权归作者所有

发表评论