Python Programming - Functions - Discussion

Discussion Forum : Functions - General Questions (Q.No. 12)
12.
What will be the result of the following code snippet?
def power(x, n=2):
    return x ** n

result = power(3)
print(result)
6
9
3
12
Answer: Option
Explanation:
The function power calculates the square of the given argument x by default, and in this case, it squares 3, resulting in 9.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.