in Python by

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

0 votes
by
Ans is

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

    """Returns sum of two numbers.

    >>> add(5, 6)

    13

    """

    return x + y
...