• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in Python by
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

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
0 votes
asked Jul 10, 2020 in Python by GeorgeBell
...