Basic Python Glossary

Key Python terms and concepts to have at your fingertips…

Lawrence Alaso Krukrubo
Intro To Data Science
5 min readDec 4, 2020

--

No doubt Python is the defacto language for Data Science and AI.

I’m sure everyone already knows that… So in this article, I’d publish a few important terms that would come in handy in your journey as a Pythonista, solving problems through Data Science and AI, using Python.

Python Programming Language.

Python is an example of a high-level language; other high-level languages you might have heard of are C, C++, Perl, and Java.

There are also low-level languages, sometimes referred to as “machine languages” or “assembly languages.” Loosely speaking, computers can only run programs written in low-level languages.

So programs written in a high-level language have to be processed before they can run. This extra processing takes some time, which is a small disadvantage of high-level languages.

The advantages are enormous…

First, it is much easier to program in a high-level language. Programs written in a high-level language take less time to write, they are shorter and easier to read, and they are more likely to be correct.

Second, high-level languages are portable, meaning that they can run on different kinds of computers with few or no modifications. Low-level programs can run on only one kind of computer and have to be rewritten to run on another.

Due to these advantages, almost all programs are written in high-level languages. Low-level languages are used only for a few specialized applications.

Python is a High-level language

Interpreters and Compilers:

An Interpreter processes the program little at a time, alternately reading lines and performing computations.

The Structure of an interpreter is basically 3-fold… The source code is passed to the interpreter, which then interprets the source code and returns an output.

A compiler translates source code into object code, which is run by a hardware executor.

The structure for a compiler is basically 5-fold. The source code is passed to the compiler, which then returns a low-level object code. The object code is then passed to the executor, which then returns the output.

An interpreter reads a high-level program and executes it, meaning that it does what the program says. It processes the program a little at a time, alternately reading lines and performing computations.

A compiler reads the program and translates it completely before the program starts running. In this context, the high-level program is called the source code, and the translated program is called the object code or the executable.

Python is considered an interpreted language.

Once a program is compiled, you can execute it repeatedly without further translation. Python is considered an interpreted language because Python programs are executed by an interpreter. There are two ways to use the interpreter: interactive mode and script mode

Glossary:

These are some basic terms we should be aware of and try to understand their importance to the Python programming language.

  1. Problem-solving: The process of formulating a problem, finding a solution, and expressing the solution.
  2. High-level language: A programming language like Python that is designed to be easy for humans to read and write.
  3. Low-level language: A programming language that is designed to be easy for a computer to execute; also called “machine language” or “assembly language.”
  4. Portability: A property of a program that can run on more than one kind of computer.
  5. Interpret: To execute a program in a high-level language by translating it one line at a time.
  6. Compile: To translate a program written in a high-level language into a low-level language all at once, in preparation for later execution.
  7. Source code: A program in a high-level language before being compiled.
  8. Object code: The output of the compiler after it translates the program.
  9. Executable: Another name for object code that is ready to be executed
  10. Prompt: Characters displayed by the interpreter to indicate that it is ready to take input from the user.
  11. Script: A program stored in a file (usually one that will be interpreted).
  12. Interactive mode: A way of using the Python interpreter by typing commands and expressions at the prompt.
  13. Script mode: A way of using the Python interpreter to read and execute statements in a python script or module.
  14. Program: A set of instructions that specifies a computation.
  15. Algorithm: A general process for solving a category of problems.
  16. Bug: An error in a program.
  17. Debugging: The process of finding and removing any of the three kinds of programming errors (Syntax, Semantic, Runtime).
  18. Syntax: The structure of a program.
  19. Syntax error: An error in a program that makes it impossible to parse (and therefore impossible to interpret).
  20. Exception: An error that is detected while the program is running.
  21. Semantics: The meaning of a program.
  22. Semantic error: An error in a program that makes it do something other than what the programmer intended.
  23. Natural language: Any one of the languages that people speak that evolved naturally.
  24. Formal language: Any one of the languages that people have designed for specific purposes, such as representing mathematical ideas or computer programs; all programming languages are formal languages.
  25. Token: One of the basic elements of the syntactic structure of a program, analogous to a word in a natural language.
  26. Parse: To examine a program and analyze the syntactic structure.
  27. Print statement: An instruction that causes the Python interpreter to display a value on the screen.

Summary:

These are essential concepts to understand as you perform programming and computational tasks in Python.

Credit: ThinkPython by Allen Downey, Ch.1

Cheers!

--

--

Lawrence Alaso Krukrubo
Intro To Data Science

Fair and Explainable AI | Data Science | Machine Learning | Deep Learning| Writer@towardsAI| AI-Nanodegree