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
Give the output of the following when num1 = 4, num2 = 3, num3 = 2.
num1 **= num2 + c print (num1)Give the output of the following when num1 = 4, num2 = 3, num3 = 2.
num1 = '5' + '5' print (num1)Give the output of the following when num1 = 4, num2 = 3, num3 = 2.
num1 = 2 + 9 * ((3*12)-8)/10 print(num1)Give the output of the following when num1 = 4, num2 = 3, num3 = 2.
num1 = float(10) print(num1)