Dictionary Length in Python

To find out the length of a dictionary, you should apply the len function:

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

print(len(dct)) # 3
Задание 1

Given a dictionary:

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

Find out the number of elements in it.

Задание 2

The following dictionaries are given:

pythondct1 = {
  'a': 12,
  'b': 34,
  'c': 56,
  'd': 78,
  'e': 90
}

dct2 = {}

Add an element to the second dictionary whose key is the name of the first dictionary and whose value is its length.