#Example of using the doctest module to make sure that your #functions work as they are supposed to. def myFunc(x): """ This is a multi-line string (used as a comment) immediately after the function definition. If you copy and paste an example run of your function (from the IDLE shell) here, doctest will run the function with the specified arguments and make sure that the output (both prints and returns) matches. If you use "#doctest: +ELLIPSIS" after the function call, you can use ellipsis (...) in your sample output to accept variable output. See below for the code needed to actually run the doctest! >>> myFunc(7) #doctest: +ELLIPSIS 2.228... 17 >>> myFunc(15) #doctest: +ELLIPSIS 4.77... 25 """ print(x / 3.14159) return(x+10) pass #This demonstrates what the special __name__ variable is. #Try "import dtExample" and see how it changes! print("__name__ is:", __name__) #This if statement will only run the doctest on the above function #if the module is ran directly (Run->Run Module F5). If you instead #import the module, the special __name__ variable will be dtExample #instead of "__main__". if __name__ == "__main__": import doctest doctest.testmod() print("I doctested it!")