Dictionaries in Python

A dictionary is a special type of data storage in the form of key-value pairs.

To create dictionaries, you need to use curly braces. Let's make an empty dictionary:

pythondct = {}

Now let's set string keys and numeric values:

pythondct = {
  'a': 1,
  'b': 2,
  'c': 3
}
Задание 1

Given a dictionary:

pythondct = {}

Add three new elements to it.

Задание 2

Let's say you have numbers 2, 4 and 6. Create a dictionary with these numbers as keys. The values ​​should be the strings 'ab', 'cd', 'ef'.

Задание 3

Create a dictionary with the keys surname, name, age. In the dictionary values, write down your last name, first name, and age.

Задание 4

Create a dictionary with months. Let the keys be the ordinal numbers of the months, and the values ​​be their names.