Run
my_dict = { 'foo':12, 'bar':14, 'moo':16 } while my_dict: removed_item = my_dict.popitem() print(f"Removed item : {removed_item}") else: print("The dictionary is emptied.")
Output