Ralfiz Academy
Free lesson · Python 1.1

Introduction & setup

What Python is, why companies use it, and how to write and run your first program.

About 30 minutesBeginner to job-readyBasics

At a glance

3 min read

What Python is, why companies use it, and how to write and run your first program.

What is Python?

Python is a high-level, general-purpose programming language created by Guido van Rossum and first released in 1991. It's known for readable code: it uses indentation instead of curly braces, and its syntax reads close to English.

Where Python is used
  • Web backends: Django, FastAPI, Flask
  • Data analysis & AI: pandas, NumPy, PyTorch
  • Automation & scripting: reports, file processing
  • APIs for mobile apps (Flutter, React Native)
  • DevOps, testing, scraping, IoT
Key characteristics
  • Interpreted: runs line by line, with no separate compile step
  • Dynamically typed: you don't declare variable types
  • Batteries included: a huge standard library
  • Multi-paradigm: procedural, OOP and functional
  • Indentation matters: 4 spaces define code blocks

Install Python on your computer

  1. Download Python 3.12 or newer from python.org/downloads. On Windows, tick "Add python.exe to PATH" during install.
  2. Install VS Code and the Python extension (by Microsoft).
  3. Check the install in a terminal:
# terminal
python --version        # Windows
python3 --version       # macOS / Linux  → Python 3.12.x or newer

python3                 # opens the interactive shell (REPL); type exit() to leave
>>> 2 + 3
5

Your first program

Create a file hello.py, type the code below, save it, and run python3 hello.py in the terminal. Or just press ▶ Run here.

# hello.py
print("Hello, World!")
print("Welcome to Ralfiz Technologies")
print("Python", "is", "fun")             # multiple values are separated by a space
print("2026", "11", "09", sep="-")        # custom separator
print("Loading", end="... ")              # end controls what comes after (default: new line)
print("done!")

Comments and indentation

# comments_indentation.py
# This is a single-line comment. Python ignores it.

"""
Triple-quoted strings are often used as multi-line notes
or as documentation (docstrings) for functions and classes.
"""

age = 20
if age >= 18:
    print("Adult")          # 4 spaces of indentation = inside the if block
    print("Can vote")
print("This line always runs")   # back to no indentation = outside the block
IndentationError: Mixing tabs and spaces, or inconsistent indentation, causes errors. Configure your editor to insert 4 spaces when you press Tab (VS Code does this by default for Python).

How Python runs your code

hello.py (source) → Compiled to bytecode (.pyc) → Python Virtual Machine → Output

You don't need to compile anything yourself. python3 file.py does it all.

Exercise solutions

Try each exercise yourself first. Then compare with these.

Exercise 1. Print your name, college and city on three separate lines.

Exercise 2. Print Ralfiz|Technologies|Kerala using one print() with three values and the sep argument.

print("Ralfiz", "Technologies", "Kerala", sep="|")

Exercise 3. Print this pattern using exactly three print statements:
* / * * / * * *

print("*")
print("* *")
print("* * *")
Hands-on lab4 steps · 1 exercise file
Quiz3 exam-style questions with explanations
Practice tests30 and 50-question mocks, scored out of 1000

The lab, quiz and practice tests for this lesson are for enrolled students, with progress saved to your own login.