Shortcuts in Python

There are cases when mathematical operations take up a lot of space in the code. For example, let's add 1 to a variable:

pythonnum = 1
num = num + 1 # add 1 to variable num
print(num) # 2

This code can be rewritten in a shortened form using the operator +=:

pythonnum = 1
num += 1 # add the number 1 to the variable num
print(num) # 2

In this way, you can also subtract a number from a variable:

pythonnum = 1
num -= 1 # subtract the number 1 from the variable num
print(num) # 0
Задание 1

Rework this code so that it has increment and decrement operations:

pythonnum = 4
num = num + 1
num = num - 1
num = num + 1