PyComplete Python Course
Beginner 30 min

Module 01 โ€” Introduction & Setup

What Python is, why half the internet runs on it, and getting your machine ready to write real code.

Prerequisite: None โ€” this is genuinely where everyone starts.

After this lesson, you will be able to

  • Explain what Python is and why it's a popular first language
  • Install Python 3 and confirm it works from a terminal
  • Install VS Code and connect it to Git Bash
  • Write, save, and run your very first .py file

Concept & Syntax

Python is a general-purpose programming language known for reading almost like plain English. It was created by Guido van Rossum and first released in 1991, and today it powers everything from Instagram's backend, to NASA's data pipelines, to the machine-learning models behind ChatGPT-style tools.

Python matters to a beginner for one practical reason: the gap between "I have an idea" and "I have working code" is smaller in Python than almost any other language. There's less punctuation to memorize and less boilerplate to type, so lessons can focus on how programs think, not on satisfying a picky compiler.

You'll sometimes see references to "Python 2" in older tutorials. Python 2 reached its official end of life on January 1, 2020, and is no longer maintained or secure to use. Every lesson on this site targets modern Python 3 โ€” if you ever see code using print "text" without parentheses, you're looking at Python 2, and you can mentally translate it to print("text").

Python is genuinely used for: web backends (Django, Flask), data analysis and visualization, automation scripts, desktop GUI apps, and the vast majority of modern AI/ML research. Its main trade-off is raw execution speed โ€” Python programs typically run slower than C++ or Rust โ€” but for most day-to-day problems, the time you save writing and debugging the code outweighs the milliseconds you lose running it.

Syntax
# The interpreter reads this file top to bottom, one statement at a time
print("Hello, World!")

Examples

Your first program Very Easy

Your first program
print("Hello, World!")
OutputHello, World!

Every Python programmer's very first program. print() is a built-in function โ€” a reusable, named piece of behavior โ€” that displays whatever you put between its parentheses.

Running from the terminal Easy

Running from the terminal
# Save the file as hello.py, then in your terminal run:
# python hello.py
#
# On some systems the command is python3 instead of python
print("Running from the command line works the same way.")
OutputRunning from the command line works the same way.

A .py file is just a plain text file. The python command hands that text to the Python interpreter, which reads and executes it line by line.

Checking your installed version Real World

Checking your installed version
# In a terminal (not inside Python), run:
# python --version
#
# Expected output looks like:
# Python 3.12.4
import sys
print(sys.version)
Output3.12.4 (main, ...) [details vary by machine]

sys.version asks Python itself what version is currently running your code โ€” useful when a tutorial behaves differently than you expect.

Visual Explanation

Your code (.py file)Python Interpreter reads itprint() runsOutput appears in the console
What happens the instant you run a Python file.
๐Ÿ” What happens internally? (advanced)

Under the hood, Python compiles your source into bytecode and runs it on a virtual machine (the CPython interpreter). Variables are names in a namespace dictionary pointing at objects in memory โ€” which is exactly what the memory panel in the tracer above is showing you.

Watch the interpreter run your first line

Use the controls below to run this example one line at a time and watch the interpreter's memory update live.

Code

Code
print("Hello, World!")

Interpreter state

Console output

Common Mistakes

โœ— Common mistake 1

Typing <code>python hello.py</code> in the wrong folder, or forgetting the <code>.py</code> extension, is the single most common beginner stumbling block.

โœ— Avoid this
This raises a 'file not found' style error
python hello
# bash: python: command not found: hello
โœ“ Better approach
Fixed
cd path/to/your/folder
python hello.py
โœ“ Best practices
  • Keep one folder per project so your files don't get scattered across your computer.
  • Name files with lowercase letters and underscores, e.g. first_program.py, never spaces.
  • Run code often โ€” every few lines โ€” instead of writing 50 lines before testing anything.
  • Install the official Python from python.org (or your OS package manager) rather than an unofficial source.

Exercise & Challenge

Exercise 1 โ€” Predict the output

Given this code
print("I am learning Python.")
print("This is line two.")

What will this program print, and how many lines of output will there be?

๐Ÿ† Challenge

Write a short program that prints your name, your favorite hobby, and one goal you have for learning Python โ€” three separate print() calls.

  • Use exactly three print() calls
  • Each should print a complete sentence
  • Save it as about_me.py and run it from your terminal
๐Ÿ’ก Need a hint?

Each print() call needs its own line and its own set of parentheses.

๐Ÿ” Show a sample solution
Python
print("My name is Asha.")
print("My favorite hobby is chess.")
print("My goal is to build my own app.")

Quiz

Answer every question, then submit to see your score and explanations.

1. What replaced Python 2, and when did Python 2 officially stop being maintained?

Python 3, on January 1, 2020
Python 4, in 2022
Python 3, in 2010
It's still maintained today
Python 2 reached end-of-life on January 1, 2020 โ€” all new code should target Python 3.

2. What does the Python interpreter do?

Compiles code into a mobile app
Reads and executes your .py file, statement by statement
Only checks for spelling mistakes
Converts Python into JavaScript
The interpreter is the program that actually runs your Python source code.

3. Which command typically runs a file named app.py from a terminal?

run app.py
python app.py
open app.py
app.py --start
python app.py (or python3 app.py) hands the file to the interpreter.

4. Why is Python popular for beginners?

It's the fastest language at runtime
Its syntax reads close to plain English, with little boilerplate
It only runs on Windows
It doesn't need to be installed
Readable syntax is Python's biggest advantage for people new to programming.

5. What file extension do Python source files use?

.py
.pt
.pyt
.python
Python source files use the .py extension.

Summary

  • Python is a beginner-friendly, general-purpose language used across web, data, automation, and AI.
  • Always use Python 3 โ€” Python 2 is retired and unsupported.
  • A .py file is plain text; the interpreter runs it top to bottom.
  • You can run files from a terminal with python filename.py.

Related lessons

Saved privately in your browser โ€” no account needed.