Python Programming - Tricky Questions - Discussion
Discussion Forum : Tricky Questions - General Questions (Q.No. 12)
12.
What will be the output of the following Python code?
def func(x, y, z):
return x + y * z
result = func(1, 2, 3)
print(result)
Answer: Option
Explanation:
The multiplication has higher precedence than addition, so the result is 1 + (2 * 3) = 7.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers