Equal Precedence in Python

Multiplication and division have equal priority and are performed in turn from left to right. Let's look at an example to see what this means. The following code will perform division first, then multiplication:

pythonres = 8 / 2 * 4
print(res) # 16 (result 4 * 4)

If you rearrange the signs, then first multiplication will be performed, and then division:

pythonres = 8 * 2 / 4
print(res) # 4 (result 16 / 4)

In the following example, each new division operation will be applied to the previous one:

pythonres = 16 / 2 / 2 / 2
print(res) # 2
Задание 1

The following code is given:

pythonres = 6 * 2 / 4
print(res)

Tell me what will be output to the console.

Задание 2

The following code is given:

pythonres = 6 / 2 * 3
print(res)

Tell me what will be output to the console.

Задание 3

The following code is given:

pythonres = 18 / 2 / 3 * 2
print(res)

Tell me what will be output to the console.