I know that a list/dictionary can be emptied by re-initializing new objects, but I want to keep the initial objects.
Also in Python 3 a list can be empty(removed) all elements, by using
clear()
. But how can be done in Python 2.7 ?Remove all keys from a dictionary ?