Created
June 17, 2013 07:49
-
-
Save elleryq/5795271 to your computer and use it in GitHub Desktop.
python doctest sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def square(value): | |
""" | |
Multiple value 2 times. | |
>>> square(2) | |
4 | |
>>> square(3) | |
9 | |
""" | |
return value * value | |
if __name__ == "__main__": | |
import doctest | |
doctest.testmod() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment