+1 vote
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

Related questions

0 votes
asked Jul 10, 2020 in Python by GeorgeBell
0 votes
asked Jul 10, 2020 in Python by GeorgeBell
...