Study Guide
From basics to OOP: syntax, data structures, functions, files and best practices
- with examples
Complete Study Guide | Key Concepts | Examples | Practice Questions
, 1. Python Basics and Setup
Python is a high-level, interpreted programming language known for readable syntax. It is used in web
development, data science, automation, AI and more. Python programs run top to bottom, and indentation (not
braces) defines code blocks.
Your first program
print("Hello, World!") # prints text to the screen
name = input("Enter your name: ") # reads user input
print("Welcome,", name)
- Python is dynamically typed: you never declare a variable's type.
- Comments start with # and are ignored by the interpreter.
- Use 4 spaces for indentation - mixing tabs and spaces causes errors.
- Python files end with .py; run them with: python filename.py
TIP: Install Python from python.org and verify with python --version. Use VS Code or PyCharm as your
editor.
Page 1