Skip to content
Python Programming

Introduction to Python

Beginner Lesson 1 of 10

Python is a high-level, interpreted programming language known for its clean syntax and readability. Created by Guido van Rossum and first released in 1991, Python has become one of the most popular programming languages in the world.

  • Beginner-Friendly: Python’s clear syntax makes it perfect for newcomers
  • Versatile: Used in web development, data science, AI, automation, and more
  • Large Ecosystem: Thousands of libraries and frameworks available
  • High Demand: One of the most sought-after skills in the job market
  • Great Community: Extensive documentation and helpful community

In this Python tutorial series, we’ll cover:

  1. Python Basics - Variables, data types, operators
  2. Control Flow - Conditionals, loops, logic
  3. Functions - Writing reusable code
  4. Object-Oriented Programming - Classes and objects
  5. Modules & Packages - Organizing your code
  6. File Handling - Working with files
  7. Exception Handling - Error management
  8. Advanced Topics - Decorators, generators, and more
  1. Download Python from python.org
  2. Run the installer
  3. Important: Check “Add Python to PATH” during installation
  4. Verify installation: Open Command Prompt and type python --version
Terminal window
# Using Homebrew (recommended)
brew install python
# Verify installation
python3 --version
Terminal window
# Ubuntu/Debian
sudo apt update
sudo apt install python3 python3-pip
# Verify installation
python3 --version

Let’s write the classic “Hello, World!” program:

# This is your first Python program!
print("Hello, World!")

Running the program:

  1. Save the code in a file called hello.py
  2. Open terminal/command prompt
  3. Navigate to the file location
  4. Run: python hello.py (or python3 hello.py on macOS/Linux)

You should see:

Hello, World!

Congratulations! You’ve written your first Python program!

Python also has an interactive mode (REPL) that’s great for experimenting:

Terminal window
$ python
Python 3.12.0 (main, Oct 2 2023, 00:00:00)
>>> print("Hello from interactive mode!")
Hello from interactive mode!
>>> 2 + 2
4
>>> exit()

Now that you have Python set up, you’re ready to dive into the basics! In the next lesson, we’ll explore:

  • Variables and data types
  • Basic operators
  • Input and output

Continue to Python Basics →

ConceptExample
Print outputprint("Hello")
Comments# This is a comment
Multi-line comments"""Triple quotes"""
Run a scriptpython script.py
Interactive modepython