Dictionary: clear method removes all items from the dictionary : Dictionary Clear « Dictionary « Python






Dictionary: clear method removes all items from the dictionary


d = {}
d['name'] = 'Gumby'
d['age'] = 42
print d

returned_value = d.clear()
print d
print returned_value

           
       








Related examples in the same category