Skip to content
Snippets Groups Projects
Commit cec7a7db authored by Matteo Rossi's avatar Matteo Rossi
Browse files

Added a doctest

parent 5ebb489b
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,15 @@ ...@@ -3,7 +3,15 @@
import numpy as np import numpy as np
def sqrt(x): def sqrt(x):
"""Evaluate the square root of a non-negative number""" """
Evaluate the square root of a non-negative number
>>> sqrt(4)
2.0
>>> sqrt(1.)
1.0
"""
return np.sqrt(x) return np.sqrt(x)
def square(x): def square(x):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment