निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
What will be the output of the following Python code?
def sum(x):
return x * x
print(sum(4))
A
8
B
16
C
4
D
Error
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
Correct Answer: B) 16