# Introduction to Python

> An introduction to Python, the interpreted, dynamically typed language created by Guido van Rossum that powers web development, automation, data, and ML.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2020-11-26 | Updated: 2026-07-18 | Topics: [Python](https://flaviocopes.com/tags/python/) | Canonical: https://flaviocopes.com/python-introduction/

Python is a general-purpose programming language known for its clear syntax.

You can use it for automation, Web development, data analysis, machine learning, command-line tools, and many other kinds of programs.

It is also a great first programming language. You can focus on learning how to solve a problem without fighting a lot of syntax.

This is a complete Python program:

```python
name = 'Flavio'
print(f'Hello {name}')
```

Save it in a file called `hello.py`, then run:

```bash
python3 hello.py
```

## What kind of language is Python?

Python is a high-level, interpreted language.

You write source code and run it with a Python interpreter. The exact details depend on the implementation you use, but you normally do not have a separate compile step before running a program.

Python is also **dynamically typed**. Values have types, but a variable name is not permanently tied to one type:

```python
value = 20
value = 'twenty'
```

This makes it quick to write programs. It also means that some mistakes are found only when the affected code runs.

You can add type hints when they make a program easier to understand:

```python
def greet(name: str) -> str:
    return f'Hello {name}'
```

Type hints do not turn Python into a statically typed language. Python itself does not enforce them at runtime, but editors and type-checking tools can use them to find problems earlier.

Python supports procedural, object-oriented, and functional programming styles. You do not need to pick one before starting.

The official [Python FAQ](https://docs.python.org/3/faq/general.html#what-is-python) has a good short description of the language.

## The standard library and third-party packages

Python comes with a large [standard library](https://docs.python.org/3/library/).

It includes modules for working with files, dates, JSON, databases, HTTP, testing, and much more.

When the standard library does not have what you need, you can install packages from the [Python Package Index](https://pypi.org/), usually called PyPI.

This combination is one of Python's biggest strengths: a useful standard library and a huge ecosystem of packages.

## How to start learning Python

Install the current Python 3 release from the official [Python downloads page](https://www.python.org/downloads/). Python 2 is no longer maintained, so new programs should use Python 3.

Once installed, check it from the terminal:

```bash
python3 --version
```

You can then start the interactive interpreter:

```bash
python3
```

The `>>>` prompt lets you try one expression at a time. It is one of the fastest ways to explore the language.

The official [Python tutorial](https://docs.python.org/3/tutorial/) is another useful reference. In the following posts I guide you through the same foundations with small, focused examples.

- [x] [Installing Python on macOS](https://flaviocopes.com/python-installation-macos/)
- [x] [Running Python programs](https://flaviocopes.com/python-running-programs/)
- [x] [Python 2 vs Python 3](https://flaviocopes.com/python-2-vs-3/)
- [x] [The basics of working with Python](https://flaviocopes.com/python-basics/)
- [x] [Data Types](https://flaviocopes.com/python-data-types/)
- [x] [Operators](https://flaviocopes.com/python-operators/)
- [x] [Strings](https://flaviocopes.com/python-strings/)
- [x] [Booleans](https://flaviocopes.com/python-booleans/)
- [x] [Working with Numbers](https://flaviocopes.com/python-numbers/)
- [x] [Accepting Input](https://flaviocopes.com/python-accept-input/)
- [x] [Control statements](https://flaviocopes.com/python-control-statements/)
- [x] [Lists](https://flaviocopes.com/python-lists/)
- [x] [Tuples](https://flaviocopes.com/python-tuples/)
- [x] [Dictionaries](https://flaviocopes.com/python-dictionaries/)
- [x] [Sets](https://flaviocopes.com/python-sets/)
- [x] [Functions](https://flaviocopes.com/python-functions/)
- [x] [Objects](https://flaviocopes.com/python-objects/)
- [x] [Loops](https://flaviocopes.com/python-loops/)
- [x] [Defining new objects using classes](https://flaviocopes.com/python-classes/)
- [x] [Modules](https://flaviocopes.com/python-modules/)
- [x] [The Standard Library](https://flaviocopes.com/python-standard-library/)
- [x] [Debugging](https://flaviocopes.com/python-debugging/)
- [x] [Variables scope](https://flaviocopes.com/python-variables-scope/)
- [x] [Accept arguments from command line](https://flaviocopes.com/python-command-line-arguments/)
- [x] [Lambda functions](https://flaviocopes.com/python-lambda-functions/)
- [x] [Recursion](https://flaviocopes.com/python-recursion/)
- [x] [Nested functions](https://flaviocopes.com/python-nested-functions/)
- [x] [Closures](https://flaviocopes.com/python-closures/)
- [x] [Decorators](https://flaviocopes.com/python-decorators/)
- [x] [Docstrings](https://flaviocopes.com/python-docstrings/)
- [x] [Introspection](https://flaviocopes.com/python-introspection/)
- [x] [Annotations](https://flaviocopes.com/python-annotations/)
- [x] [List files in a directory](https://flaviocopes.com/python-list-files-folders/)
- [x] [Get the details of a file](https://flaviocopes.com/python-get-file-details/)
- [x] [Exceptions](https://flaviocopes.com/python-exceptions/)
- [x] [Check if a file or directory exists](https://flaviocopes.com/python-check-file-exists/)
- [x] [Create an empty file](https://flaviocopes.com/python-create-empty-file/)
- [x] [Create a directory](https://flaviocopes.com/python-create-directory/)
- [x] [Write to a file](https://flaviocopes.com/python-write-to-file/)
- [x] [Read the content of a file](https://flaviocopes.com/python-read-file-content/)
- [x] [The `with` statement](https://flaviocopes.com/python-with-statement/)
- [x] [Create a network request](https://flaviocopes.com/python-create-network-request/)
- [x] [Create a Web (HTTP) server](https://flaviocopes.com/python-http-server/)
- [x] [Create a TCP server](https://flaviocopes.com/python-tcp-server/)
- [x] [Installing 3rd party packages](https://flaviocopes.com/python-pip/)
- [x] [Regular Expressions](https://flaviocopes.com/python-regular-expressions/)
- [x] [List comprehensions](https://flaviocopes.com/python-list-comprehensions/)
- [x] [GUI programming with Tkinter](https://flaviocopes.com/python-tkinter/)
- [x] [Polymorphism](https://flaviocopes.com/python-polymorphism/)
- [x] [Operator overloading](https://flaviocopes.com/python-operator-overloading/)
- [x] [Intro to multithreading](https://flaviocopes.com/python-multithreading/)
- [x] [map](https://flaviocopes.com/python-map/)
- [x] [reduce](https://flaviocopes.com/python-reduce/)
- [x] [filter](https://flaviocopes.com/python-filter/)
