AD JB Toolbox 01 EN

Python Tutorial / What Is Python? Features and Practical Uses

Python is a general-purpose programming language with readable syntax. You can use it to organize files, process data and build web services; this course connects the fundamentals through programs that accept, validate and store expense data.

Understand what runs a Python program

A program is a set of instructions that takes input, applies rules and produces a result. The Python interpreter is the program that runs Python source code. Saving a file with a .py extension does not by itself tell every operating system how to execute its contents.

For the relevant APIs and platform requirements, see What Is Python? Features and Practical Uses documentation.

Task Example What else you need
Automation Find CSV files and calculate totals Input files and permission to read them
Data analysis Group expenses by category A package such as pandas when appropriate
Web services Return JSON for an HTTP request A web framework and a deployment environment

The core examples use Python 3.12 or later and emphasize data types, control flow, functions and input/output. They do not require every feature of the newest release. A mobile interface or a high-performance game engine involves additional tools and design decisions.

Separate the editor, terminal and interactive prompt

An editor creates source files. A terminal accepts operating-system commands. The interactive Python prompt lets you try Python expressions directly. Enter python hello.py in the terminal and put print(...) in the file or Python prompt. Do not copy interactive prompt characters into a script.

Create a practice folder and save source files as UTF-8. Keep the code and its expected output together so you can compare them. Changing one value at a time makes it easier to identify which part of a program caused a different result.

Run a complete first example

Save the complete code below as hello.py in a separate practice folder, using UTF-8. Run python hello.py in a terminal with your project virtual environment selected. Outside a virtual environment on macOS or Ubuntu, use python3 when that is your interpreter command.

name = "Python"
amounts = [3500, 8000, 2500]
print(f"Hello, {name}!")
print("total:", sum(amounts))

Expected output:

Hello, Python!
total: 14000

Trace the values and make a controlled change

name refers to a text value; amounts contains three numbers in a list. The built-in sum() function adds those numbers. Follow the input, calculation and output before trying to memorize every syntactic detail.

  1. Change 8000 to 9000 and check that the total becomes 15000.
  2. Restore 8000. Change only the name Python and verify that the total remains 14000.
  3. If you add unexpected indentation at the beginning of a line and see an error, remove it before continuing.

A command-not-found message concerns the interpreter command or its path. A cannot-open-file message may concern the working directory or filename. Read the last line of the error first, then distinguish interpreter selection from source-file location.

More in This Category
Python Tutorial / Set Up Python on macOS and Ubuntu

Python Tutorial / Set Up Python on macOS and Ubuntu

Prepare a Python development environment on macOS or Ubuntu without replacing system Python. Verify paths, create a virtual environment and test execution.

Python Tutorial / Write and Run Python in VS Code

Python Tutorial / Write and Run Python in VS Code

Choose a virtual-environment interpreter in VS Code, run a complete Python script and use a breakpoint to check values while diagnosing environment mismatches.

Python Tutorial / Build a First Program with Variables, Input and Output

Python Tutorial / Build a First Program with Variables, Input and Output

Read expense input, convert text to an integer and format a result. Understand assignment, comments, f-strings and the source of common conversion errors.

Python Tutorial / Create Virtual Environments and Manage Packages with pip

Python Tutorial / Create Virtual Environments and Manage Packages with pip

Use venv and python -m pip to separate projects, record dependencies and troubleshoot interpreter, package and activation problems.

Python Tutorial / Install Python on Windows and Verify the Interpreter

Python Tutorial / Install Python on Windows and Verify the Interpreter

Set up Python on Windows with the official Install Manager, create a project environment, and verify command resolution, versions and executable paths.

Python Tutorial / What Is Python? Features and Practical Uses

Python Tutorial / What Is Python? Features and Practical Uses

Understand Python’s role, distinguish source files from the interpreter and terminal, and run a complete expense-total example with a small follow-up experiment.