References#

🏛️ Lecture 2

ENPM605 — L2: Python Fundamentals — Part I

Covers packages and modules, indentation, Boolean type and truthiness, operators (arithmetic, relational, logical, membership, identity), numeric types and interning, strings (formatting, methods, indexing, slicing), and control flow.

🐍 Python Language References
📦 Modules and Packages

Tutorial — Section 6

Modules, packages, __init__.py, and sys.path.

https://docs.python.org/3/tutorial/modules.html
📦 The Import System

Language Reference — Import

Complete reference for Python’s import machinery.

https://docs.python.org/3/reference/import.html
📘 Expressions and Operators

Language Reference — Expressions

Complete reference for Python expressions and operator precedence.

https://docs.python.org/3/reference/expressions.html
✅ Truth Value Testing

Standard Library — Truth Value Testing

Rules for which objects are truthy and falsy.

https://docs.python.org/3/library/stdtypes.html#truth-value-testing
🔤 String Methods

Standard Library — str

Complete reference for all built-in string methods.

https://docs.python.org/3/library/stdtypes.html#string-methods
📐 Format Specification

Format Specification Mini-Language

Detailed rules for f-string format specifiers.

https://docs.python.org/3/library/string.html#formatspec
🔢 Numeric Types

Standard Library — Numeric Types

Reference for int, float, and complex operations.

https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex
🔢 Floating-Point Arithmetic

Tutorial — Floating-Point Issues

Why 0.1 + 0.2 != 0.3 and how to handle it.

https://docs.python.org/3/tutorial/floatingpoint.html
🔀 Control Flow

Tutorial — Section 4

if statements, for and while loops, and more.

https://docs.python.org/3/tutorial/controlflow.html
📏 Style and Best Practices
📏 PEP 8 — Style Guide

Coding Conventions

Indentation (4 spaces), naming conventions, import ordering, and line length.

https://peps.python.org/pep-0008/
📝 PEP 328 — Imports

Multi-Line and Absolute/Relative Imports

The PEP that formalized Python’s import system conventions.

https://peps.python.org/pep-0328/
📝 PEP 498 — f-strings

Literal String Interpolation

The PEP that introduced formatted string literals in Python 3.6.

https://peps.python.org/pep-0498/
📚 Recommended Reading
📘 Python Official Tutorial

Getting Started

Sections 3 (informal introduction), 4 (control flow), and 5 (data structures).

https://docs.python.org/3/tutorial/
Mark Lutz

Learning Python (5th Edition)

Chapters 4–7 cover core types: numbers, strings, lists, and dictionaries.

Luciano Ramalho

Fluent Python (2nd Edition)

Chapters 2 (sequences) and 4 (Unicode and bytes) provide advanced string and sequence coverage.

Brett Slatkin

Effective Python (2nd Edition)

Items 1–10 cover Pythonic thinking including f-strings, slicing, and truthiness patterns.