Changing the value of a dictionary item in Python

You can change the value of a dictionary element by its key. To do this, after specifying the key, after the operator =, we write the new value.

Let's look at an example. Let's say we have the following dictionary:

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

Let's change its element:

pythondct['a'] = '!'

Let's look at the changed dictionary:

pythonprint(dct) # {'a': '!', 'b': 2, 'c': 3}
Задание 1

Given a dictionary:

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

Increment the element with key 'x' by one.

Задание 2

Given a dictionary:

pythondct = {
  'surn': 'smit',
  'name': 'john'
}

Change the values ​​for the keys 'surn' and 'name' to your last name and first name.