len() This method is used to return the length of the dictionary. That is, the number of items (key-value pairs) Example: dict1={‘name’:’john’,’course’:’B.Tech’,’Stipen’:9000} print(len(dict1)) Output: 3 clear() This method to delete all entries in the dictionary. Example: dict1={‘name’:’john’,’course’:’B.Tech’,’Stipen’:9000} dict1.clear() print(dict1) Output: ...
Home/built-in methods of dictionary