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)
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:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers