Grouping Brackets in Python

If you want, you can specify the priority of operations using parentheses. For example, let's rework our code so that addition is performed first, and then multiplication:

pythonres = 2 * (2 + 3)
print(res) # 10 (result 2 * 5)

There can be any number of brackets, including those nested within each other:

pythonres = 2 * (2 + 4 * (3 + 1))
print(res) # 36
Задание 1

The following code is given:

pythonres = (2 + 3) * 4
print(res)

Tell me what will be output to the console.

Задание 2

The following code is given:

pythonres = (10 - 6) / 3
print(res)

Tell me what will be output to the console.

Задание 3

The following code is given:

pythonres = 10 - 6 * (3 - 5)
print(res)

Tell me what will be output to the console.

Задание 4

The following code is given:

pythonres = 4 - 1 + (5 + 6 * (2 + 7))
print(res)

Tell me what will be output to the console.