Python is an interpreted, high-level language created by Guido van Rossum and released in 1991. It is dynamically typed and garbage collected.
Python programs have the extension .py and can be run from the command line by typing python file_name.py.
Probably its most noticeable characteristic is its use of significant white space to delimit code blocks, instead of the more popular {} symbols.
End-of-line semicolons (;) are optional and usually not used in Python.
Python becomes the best solution in many domains from web applications, data analysis, data science, machine learning, and AI.
Functions are defined using the def keyword.
# functions
def allowed_to_drive(age):
if age >= 21:
return True
else:
return False
print(allowed_to_drive(42)) # True
print(allowed_to_drive(12)) # False