KnowledgeBoat Logo
|

Informatics Practices

Give the output of the following when num1 = 4, num2 = 3, num3 = 2.

print(4.00 / (2.0+2.0))

Python Control Flow

1 Like

Answer

1.0

Working

1. Evaluate the expression inside the parentheses first:

2.0 + 2.0

This calculation is straightforward:

2.0 + 2.0 = 4.0

2. Perform the division operation:

4.00 / 4.0 = 1.0

3. Print the result:

print(1.0)

Therefore, the output of the given code snippet is:

1.0

Answered By

2 Likes


Related Questions