Python: Defining Functions

Published: 12 March 2012
on channel: Barry Brown
88,473
335

A video about writing simple functions in the Python programming language. We start by defining a function in the Python Shell. Then we show how to write the same function in a text editor and include unit tests (using the doctest module).

To use doctest, include the following three lines at the bottom of your file:

if _name_ == "__main__":
import doctest
doctest.testmod(verbose=True, optionflags=doctest.NORMALIZE_WHITESPACE)


On this page of the site you can watch the video online Python: Defining Functions with a duration of hours minute second in good quality, which was uploaded by the user Barry Brown 12 March 2012, share the link with friends and acquaintances, this video has already been watched 88,473 times on youtube and it was liked by 335 viewers. Enjoy your viewing!