Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following Python code?
>>> a=(2,3,4)
>>> sum(a,3)

What will be the output of the following Python code?
>>> a=(2,3,4)
>>> sum(a,3)
a) Too many arguments for sum() method
b) The method sum() doesn’t exist for tuples
c) 12
d) 9

Answer: c
Explanation: In the above case, 3 is the starting value to which the sum of the tuple is added to.

Join The Discussion