Part 1: Core Concepts (2 Marks)
- Python Paradigm: An interpreted, high-level, dynamically typed, garbage-collected language supporting procedural, object-oriented, and functional programming.
- Indentation Rule: Python uses whitespace indentation (4 spaces standard) rather than curly braces
{} to delimit code blocks.
- Dynamic Typing vs Strong Typing:
- Dynamically Typed: Variable types are resolved at runtime without explicit type declarations (
x = 10; x = "hello").
- Strongly Typed: Python will not implicitly coerce incompatible types (
"Age: " + 20 raises TypeError).
Part 2: Structural Frameworks (10 Marks)
Mutable vs Immutable Built-In Types
Part 3: Distinction Tables
Part 4: Worked Problems & Exam Traps
Python Control Flow with elif
score = 85
if score >= 90:
grade = "A"
elif score >= 80:
grade = "A-"
elif score >= 70:
grade = "B+"
else:
grade = "F"
print(f"Grade: {grade}")
Mixing tabs and spaces for indentation triggers IndentationError: unindent does not match any outer indentation level. Always use 4 consistent spaces.