Skip to main content

Python

Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/python

In short

Python is a general-purpose, dynamically typed programming language known for readable syntax and wide use in data science, automation, and web backends.

What is Python?

Python is a high-level, general-purpose programming language created by Guido van Rossum and first released in 1991. It is known for readable code that uses indentation instead of curly braces to mark blocks, and for a large standard library that covers everything from file handling to web requests. Python 3 is the current version; Python 2 reached its end of life in 2020.

Python is dynamically typed, meaning variables don't have declared types and type checks happen while the program runs. It is also strongly typed, so '3' + 4 raises an error instead of silently converting one of the values. Optional type hints, such as def greet(name: str) -> str, can be checked by separate tools but are ignored by the interpreter at runtime. Memory is managed automatically: the standard implementation, CPython, uses reference counting plus a garbage collector that cleans up reference cycles.

Python is used for data analysis, machine learning, scientific computing, automation scripts, web backends, and teaching programming. Its code is often described as reading almost like pseudocode, which makes it a common first language. A huge ecosystem of third-party packages, installed with the pip tool, extends it into almost every field.

Python is often called an interpreted language, which is only partly accurate. CPython first compiles source code into bytecode and then runs that bytecode in a virtual machine, similar in spirit to Java, but Java's JVM compiles hot code to machine code while CPython mostly interprets it, so pure Python code usually runs slower. For heavy number crunching, popular Python libraries do the actual work in compiled C, C++, or Rust code underneath.

Key takeaways

  • Python uses indentation to define code blocks, which keeps code visually consistent.
  • It is dynamically but strongly typed, with optional type hints.
  • Memory is managed automatically through reference counting and garbage collection.
  • It is widely used for data science, machine learning, automation, and web backends.

Example

Counting words with the standard librarypython
# Count how often each word appears
from collections import Counter

text = "the quick brown fox jumps over the lazy dog the end"
counts = Counter(text.split())

for word, count in counts.most_common(3):
    print(f"{word}: {count}")

Readers ask

Is Python good for beginners?

Python is one of the most common first languages because its syntax is short and readable and its interactive shell gives instant feedback. The concepts you learn, such as variables, loops, and functions, carry over to other languages.

Is Python compiled or interpreted?

Both, in a sense. The standard implementation, CPython, compiles source code to bytecode and then runs that bytecode in a virtual machine, so from a developer's point of view it behaves like an interpreted language.

What is the difference between Python 2 and Python 3?

Python 3 is the current version and is not fully backward compatible with Python 2; for example, print became a function and strings became Unicode by default. Python 2 reached end of life in January 2020, so new code should use Python 3.

Often compared

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings