Python Basics

Python Introduction

Learn what Python is, why it is so popular, and what you can build with it.

What is Python?

Python is a popular programming language created by Guido van Rossum and released in 1991. It is used for:

  • Web development (Django, Flask, FastAPI)
  • Software development
  • Mathematics and Data Science
  • System scripting
  • Artificial Intelligence and Machine Learning

Why Python?

Python has become one of the world's most popular programming languages because:

  • Simple syntax — Python was designed to be readable and resembles plain English
  • Versatile — Works on different platforms (Windows, Mac, Linux)
  • Fast prototyping — Write powerful code with fewer lines
  • Large ecosystem — Thousands of libraries and frameworks
  • AI & ML dominance — The go-to language for machine learning

Python Syntax vs Other Languages

Python uses indentation (whitespace) to define code blocks instead of curly braces {}. This makes Python code clean and readable.

Python Versions

The two major versions are Python 2 and Python 3. This tutorial uses Python 3 which is the current version and is recommended for all new projects.

Example

python
# Python is easy to read
print("Hello, World!")

# Variables need no declaration
name = "DevForge"
age = 5
pi = 3.14159
is_awesome = True

# Python uses indentation
if is_awesome:
    print(f"{name} is awesome!")
    print(f"Age: {age}")

# Lists are flexible
languages = ["Python", "JavaScript", "Rust"]
for lang in languages:
    print(f"I love {lang}")
Try it yourself — PYTHON