Mega Code Archive

 
Categories / Python Tutorial / Dictionary
 

Clear method removes all items from the dictionary

d = {'host': 'earth', 'port': 80} print d returned_value = d.clear()  print d  print returned_value