निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
What will be the output of the following Python code?
def sum(x):
return x * x
print(sum(4))
A)
B)
C)
D)
Explanation:
The function sum(x)
returns the square of the input x
, as it calculates x * x
.
When calling sum(4)
, it will compute 4 * 4 = 16
.
So, the output will be 16.
Answer: (B) 16