Categories

Jul 16 in Python
Q:

Q. Which of the following is a valid doctest?

A. def add(x, y):    

    """Returns sum of two numbers.

    >>> add(5, 6)

    13

    """

    return x + y

B. def add(x, y):

    """Returns sum of two numbers.

    """

    >>> add(5, 6)

    13

    return x + y

C. def add(x, y):

    """Returns sum of two numbers.

    add(5, 6)

    13

    """

   return x + y

D. def add(x, y):

  return x + y

1 Answer

Jul 16
Ans is

def add(x, y):    ----

    """Returns sum of two numbers.

    >>> add(5, 6)

    13

    """

    return x + y
Click here to read more about Python
Click here to read more about Insurance

Related questions

Madanswer
Jul 10 in Python
Jul 10 in Python
Jun 30 in Python
...