reading-note

https://eng-ehabsaleh.github.io/reading-note/

View on GitHub

Unit tests and TDD?

Unit tests are some pieces of code to exercise the input, the output and the behaviour of your code. You can write them anytime you want.

Important aspects about the unit test

There are some details to pay attention. The first one is the test name. The tests can be considered as your alive documentation. We need to be descriptive about it and to say what is expected and what we are testing

What does the if name == “main”: do?

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**

what is the module??

A module is a file containing Python definitions and statements. The file name is the module name with the suffix .py appended.

Recursion

The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called as recursive function. Using recursive algorithm, certain problems can be solved quite easily