Introduction to Python · 2 / 10 Theory

Python Features

Python is a high-level, general-purpose programming language known for its simplicity. These are its key features:

Main features

  • Easy to read and write: its syntax is close to English and uses indentation instead of braces to delimit blocks of code.
  • Interpreted: you run the program directly with the interpreter, without a separate compilation step that you have to launch yourself.
  • Dynamically typed: you do not declare the type of a variable; Python knows it from the value you assign.
  • Multi-paradigm: you can program in a procedural, object-oriented or functional style.
  • Everything is an object: numbers, text, functions and classes are objects.
  • Automatic memory management: a garbage collector frees the memory you no longer use.
  • "Batteries included": the standard library covers files, dates, mathematics, networking, JSON, compression and much more.
  • Huge ecosystem: the package index PyPI offers hundreds of thousands of libraries that you can install with pip.
  • Cross-platform: the same program runs on Windows, macOS and Linux.
  • Open source and free: it is developed by a worldwide community under the Python Software Foundation.

An example

This is a complete program that asks for a name and greets the user:

name = input("What is your name? ")
print(f"Hello, {name}!")

Two lines are enough. There is no need to declare types, to write a main function or to compile anything first.

Where is Python used?

Python is used for web development, data analysis, artificial intelligence, automation, scientific computing, scripting, game development and teaching, among many other fields.