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)
9
7
8
1
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:

Your comments will be displayed after verification.