COMPILE TIME AND RUNTIME CODE CHECKING
Python performs some compile-time checking, but most checks (including type, name, and so forth) are deferred until code execution. Consequently, if your Python code references a user-defined function that does not exist, the code will compile successfully. In fact, the code will fail with an exception only when the code execution path references the non-existent function.
As a simple example, consider the following function myFunc that references the non-existent function called DoesNotExist:
def myFunc(x):
if x == 3:
print(DoesNotExist(x))
else:
print('x: ',x)
The preceding code will only fail when the myFunc function has passed the value 3, after which Python raises an error.
In Chapter 2, you will learn how to define and invoke user-defined functions, along with an explanation of the difference between local versus global variables in Python.
Now that you understand some basic concepts (such as how to use the Python interpreter) and how to launch your custom modules, the next section discusses primitive data types.