Python Introduction

Beginner
⏱️ 14 min read
📚 Updated: Jul 2026
🎯 5 Examples
print · pip · REPL

What You’ll Learn

This page is a self-contained introduction to Python—one of the world’s most popular programming languages. You will understand what Python is, who created it, and write your first programs in minutes.

01

What is Python

Language overview.

02

Creator

Guido van Rossum.

03

Internals

CPython & C.

04

Hello World

First program.

05

Use cases

Where it shines.

06

Examples

Hands-on code.

🤔 What is Python?

Python is a popular high-level, interpreted programming language widely used for general-purpose programming, scientific computing, data analysis, web development, automation, and artificial intelligence.

It was first released in 1991 and has become one of the most widely used languages in the world. Python is known for its simplicity, readability, and ease of use, making it a favorite among beginners and experienced developers alike.

A large, active community maintains Python itself and thousands of libraries on PyPI—from NumPy and pandas for data science to Django and Flask for web apps.

💡
Beginner tip

Python uses indentation (spaces) to define code blocks instead of curly braces. Keep indentation consistent—usually four spaces per level.

👴 Who Is the Father of Python?

Guido van Rossum is considered the father of Python. He created the language in the late 1980s and released the first version in 1991 while working at the Centrum Wiskunde & Informatica (CWI) in the Netherlands.

The name comes from the British comedy group Monty Python—not the snake. Guido served as Python’s “Benevolent Dictator For Life” (BDFL) for decades before stepping down; development continues through PEPs and community consensus.

EventYearHighlight
Python 0.9.01991First public release by Guido van Rossum
Python 2.02000List comprehensions, garbage collection
Python 3.02008Modern Unicode-first design
Python 2 EOL2020Python 2 no longer maintained
Python 3.12+2023+Faster CPython, improved error messages

✍️ What Language Is Python Written In?

The reference implementation, CPython, is mostly written in C. Parts of the standard library use C, C++, and Python itself. When CPython is built, Python source is compiled to bytecode, and the C runtime executes it on your machine.

Alternative implementations exist—PyPy (JIT-focused), Jython (JVM), IronPython (.NET)—but CPython from python.org is what most learners and production systems use.

💻 Install and Run Python

Download Python 3 from python.org, then verify and run a script:

terminal
python --version
python demo.py
  • python or python3 — starts the interpreter (platform-dependent name)
  • pip install requests — installs packages from PyPI
  • python -m venv .venv — creates an isolated virtual environment per project
  • IDLE, VS Code, or PyCharm provide friendly editors for beginners

📄 Hello World in Python

Here is a simple Python program that prints Hello, World! to the console:

demo.py
print("Hello, World!")

Save the file as demo.py and run python demo.py. The print() function sends text to the terminal. No semicolons required.

🤔 Where Is Python Used?

Python is widely used across industries and fields:

  1. Data science and machine learning — libraries like NumPy, pandas, scikit-learn, TensorFlow, and PyTorch power analytics and AI worldwide
  2. Web development — Django, Flask, and FastAPI build backends and APIs for startups and enterprises
  3. Automation and scripting — automate file tasks, testing, DevOps, and repetitive office workflows
  4. Major tech companies — Google, Amazon, Meta (Facebook/Instagram), Netflix, Spotify, and many others use Python in production systems
  5. Science and space — NASA and research labs use Python for scientific computing, simulations, and data analysis in exploration missions
  6. Education — taught in schools and universities as a first programming language

🧰 Core Building Blocks

ConceptWhat it does
Variablesname = "Alex" — no type keyword needed
Data typesstr, int, float, bool, list, dict
IndentationDefines blocks after if, for, def
Functionsdef greet(): reusable named blocks
Modulesimport math share code across files
pip / venvInstall packages and isolate project dependencies

⚡ Quick Reference

TaskPython code
Printprint("Hi")
Variableage = 20
Conditionif x > 0:
Loopfor i in range(5):
Functiondef add(a, b): return a + b
Comment# line comment

Examples Gallery

Five starter programs. Save each as a .py file and run with python filename.py, or paste into the interactive REPL.

Example 1 — Hello, World!

demo.py
print("Hello, World!")

Example 2 — Variables and types

demo.py
name = "Alex"
age = 20
is_student = True

print("Name:", name)
print("Age:", age)
print("Student:", is_student)

Example 3 — f-strings for formatted output

demo.py
language = "Python"
version = 3.12

print(f"Welcome to {language} {version}!")

Prefix a string with f to embed variables inside {curly braces}.

Example 4 — Even or odd with if-else

demo.py
n = 7

if n % 2 == 0:
    print(f"{n} is even")
else:
    print(f"{n} is odd")

Notice the colon and indented block—indentation is part of Python syntax.

Example 5 — Loop with range()

demo.py
total = 0
for i in range(1, 6):
    total += i

print("Sum 1..5 =", total)

🧠 How Python Runs Your Code

1

You write source

Save human-readable .py files with functions, classes, and statements.

Source
2

CPython compiles

The interpreter parses code into bytecode (.pyc caches may be created).

Bytecode
3

Python Virtual Machine

The PVM executes bytecode line by line, calling C extensions and your functions.

Execute
=

Output appears

print() writes to the terminal; files, APIs, or GUIs receive other results.

Summary

  • Python is a readable, versatile, interpreted language for web, data, AI, and automation.
  • Created by Guido van Rossum; first released in 1991; use Python 3 today.
  • CPython is mostly written in C and is the standard runtime.
  • Start with print(), variables, if/for, and functions.
  • Used by Google, Amazon, Meta, NASA, and millions of developers worldwide.
  • Next step: explore Python string methods and interview programs.

💡 Best Practices

✅ Do

  • Use Python 3 and a virtual environment per project
  • Follow PEP 8 style: 4-space indents, descriptive names, docstrings
  • Read tracebacks from bottom to top when debugging
  • Use pip freeze > requirements.txt to track dependencies
  • Prefer built-in types and the standard library before adding packages
  • Write small scripts first; refactor into functions as they grow

❌ Don’t

  • Mix tabs and spaces—indentation errors are common for beginners
  • Install packages globally when a venv keeps projects isolated
  • Use Python 2 tutorials or syntax (print "hi" without parentheses)
  • Ignore NameError and IndentationError messages—they pinpoint the fix
  • Skip testing edge cases on user input
  • Commit virtual environment folders (.venv) to git unnecessarily

❓ Frequently Asked Questions

Python is a high-level, interpreted programming language known for readable syntax. It is used for web development, data science, automation, scripting, AI, and general-purpose software.
Yes. Python uses indentation instead of braces, reads like English in many examples, and lets you see results quickly with print(). It is one of the most recommended first languages worldwide.
Download the latest stable release from python.org for Windows, macOS, or Linux. Verify with python --version or python3 --version. pip installs third-party libraries.
Python 2 reached end of life in 2020. Always learn and use Python 3. Modern tutorials, libraries, and jobs assume Python 3 syntax and features.
Yes. Python is developed under an open-source license by the Python Software Foundation and a global community. You can use it freely in personal and commercial projects.
Practice variables, strings, lists, loops, and functions. Then explore file I/O, modules, virtual environments, and libraries like requests, pandas, or Django/Flask depending on your goals.
Fun fact

Python has a Zen philosophy. Its design is guided by principles called The Zen of Python, which emphasize simplicity, readability, and practicality. Open a Python shell and type import this to read them—including the famous line: “Readability counts.”

Try It Yourself

Install Python 3, save the Hello World example, and run it from your terminal.

Explore String Methods →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful