निम्नलिखित कोड का परिणाम क्या है ?
What is the output of the following code ?
def add(a, b):
return a+5, b+5
result = add(3, 2)
print(result)
A)
B)
C)
D)
Explanation:
Let's break down the code:
The function add(a, b)
takes two arguments, a
and b
, and returns two values: a+5
and b+5
.
In this case, the function is called with a = 3
and b = 2
. So:
a + 5 = 3 + 5 = 8
b + 5 = 2 + 5 = 7
The function returns the tuple (8, 7)
.
When you print the result, it will display the tuple (8, 7)
.
Answer: (C) (8, 7).