Uklanjanje svih elemenata iz rečnika u Pythonu

Ukloniti sve elemente iz rečnika možemo uz pomoć metode clear:

pythondct = {
  'a': 1,
  'b': 2,
  'c': 3
}

dct.clear()
print(dct) # ispisaće {}
Задание 1

Dat je rečnik:

pythondct = {
  'x': 1,
  'y': 2,
  'z': 3
}

Očistite ga.

Задание 2

Dat je sledeći kod:

pythondct = {
  1: 'text1',
  2: 'text2',
  3: 'text3'
}

dct.clear()
dct[4] = 'text4'
print(dct)

Recite šta će biti ispisano u konzoli.