Computer Science · Ch 5 — Getting Started with Python
Features of Python
5.1.1
Features of Python
Python's popularity as a first programming language comes from a specific set of features, each of which shapes how we write and run programs in it.
The features, one by one
- High-level language. Python instructions read close to English, so a person can write and follow them without dealing in 0s and 1s.
- Free and open source. Python costs nothing to download and use, and its source is openly available. The latest version of Python 3 can be downloaded from the official website, https://www.python.org/.
- Interpreted language. Python programs are executed by an interpreter, which translates and runs statements one at a time (as described in the previous section).
- Easy to understand. Python has a clearly defined syntax and a relatively simple structure, so programs written in it are easy to read and follow.
- Case-sensitive. Python treats uppercase and lowercase letters as different. For example,
NUMBERandnumberare two entirely different names in Python:
number = 10
print(number)
# print(NUMBER) would fail — NUMBER was never defined
10
- Portable and platform independent. The same Python program can run on various operating systems and hardware platforms without change.
- Rich library of predefined functions. Python ships with a large collection of ready-made functions, so many common tasks need no code of our own.
- Useful for web development. Many popular web services and applications are built using Python.
- Indentation defines blocks. Python uses indentation (leading spaces) to mark blocks of code and nested blocks, rather than braces or keywords. The visual layout of a Python program therefore mirrors its logical structure.