Introduction

Python is a clear, general-purpose language used for the web, data, scripting and AI.

Syntaxprint(value)

Python is one of the most popular programming languages in the world. It reads almost like plain English, which makes it a favourite for beginners and experts alike.

What is Python used for?

  • Web development with frameworks like Django and Flask.
  • Data science and AI with tools like pandas, NumPy and PyTorch.
  • Automation and scripting to handle repetitive tasks.
  • Everyday programs, from small tools to large applications.

In these lessons every example is real Python. Because Python runs on a computer (not in the browser), the code here is shown with its output written in a comment so you can see exactly what it prints.

Example

Example · python
print('Hello, World!')
print('Python is fun to learn.')

# Output:
# Hello, World!
# Python is fun to learn.

When to use it

  • A data analyst writes a Python script to clean and summarise a CSV of sales records.
  • A developer builds a REST API with Flask to serve mobile app requests.
  • A sysadmin automates nightly server health checks with a short Python script.

More examples

Print a greeting

Shows how print() outputs text to the terminal — the simplest Python program.

Example · python
print('Hello, World!')
print('Python is fun to learn.')

# Output:
# Hello, World!
# Python is fun to learn.

Basic calculation and output

Demonstrates assigning values to variables and printing a computed result.

Example · python
price = 4.99
quantity = 3
total = price * quantity
print('Total:', total)

# Output:
# Total: 14.97

Simple list and loop

Illustrates that Python supports lists and loops with concise, readable syntax.

Example · python
uses = ['web', 'data science', 'automation', 'AI']
for use in uses:
    print('Python is used for', use)

# Output:
# Python is used for web
# Python is used for data science
# Python is used for automation
# Python is used for AI

Discussion

  • Be the first to comment on this lesson.