Python Programming - Tricky Questions - Discussion
Discussion Forum : Tricky Questions - General Questions (Q.No. 22)
22.
What is the output of the following Python code?
def some_function(x, y, z):
return x + y ** z
result = some_function(x=1, y=2, z=3)
print(result)
Answer: Option
Explanation:
The exponent has higher precedence than addition, so the result is 1 + (2 ** 3) = 9.
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