Testing and Modules
SOURCES
VIDEOS
What on Earth is Recursion
Python Modules and Packages Companion Video
ARTICLES
In Tests We Trust - TDD with Python
If name equals main
Intro to Recursion
NOTES
In Tests We Trust
- A common structure convention is AAA- Arrange, Act, Assert
- Arrange- organize the data needed to execute the input
- Act- this is where the code is executed
- Assert- after running the code, check to see if the output is the expected result
- Writing a test first can make writing the bulk of the code simpler because you write it to PASS the test
If name equals main
- I have no idea what this article is saying.
- from the article: “Before executing code, Python interpreter reads source file and define few special variables/global variables.
If the python interpreter is running that module (the source file) as the main program, it sets the special name variable to have a value “main”. If this file is being imported from another module, name will be set to the module’s name. Module’s name is available as value to name global variable.
A module is a file containing Python definitions and statements. The file name is the module name with the suffix .py appended. “
What on Earth is Recursion
- Genuinely no idea what this is. The dude just said factoral 1 million times like im supposed to know what that even is.
- Recursion is, in the simplest terms I can think of it, as mulitplying a number by every positive number counting down uinder it so f(6) would be 65432*1=144