References#

🏛️ Lecture 3

ENPM605 — L3: Python Fundamentals — Part II

Covers loops (for, while), the range() function, iterables, in-place vs out-of-place operations, lists and list comprehensions, tuples and unpacking, dictionaries, and sets with mathematical operations.

🐍 Python Language References
🔄 for Statements

Tutorial — Control Flow

for loops, iteration over sequences, and the range() function.

https://docs.python.org/3/tutorial/controlflow.html#for-statements
🔢 The range Type

Standard Library — range

Complete reference for range() objects and their properties.

https://docs.python.org/3/library/stdtypes.html#range
📋 Lists

Tutorial — Data Structures

List methods, list comprehensions, and common operations.

https://docs.python.org/3/tutorial/datastructures.html#more-on-lists
📦 Tuples and Sequences

Tutorial — Data Structures

Tuple creation, unpacking, and use cases.

https://docs.python.org/3/tutorial/datastructures.html#tuples-and-sequences
📖 Dictionaries

Tutorial — Data Structures

Dictionary creation, access patterns, and iteration.

https://docs.python.org/3/tutorial/datastructures.html#dictionaries
🎯 Sets

Tutorial — Data Structures

Set operations, methods, and use cases.

https://docs.python.org/3/tutorial/datastructures.html#sets
📋 Sequence Types

Standard Library — Sequences

Complete reference for list, tuple, and range types.

https://docs.python.org/3/library/stdtypes.html#sequence-types-list-tuple-range
📖 Mapping Types

Standard Library — dict

Complete reference for dictionary methods and operations.

https://docs.python.org/3/library/stdtypes.html#mapping-types-dict
🎯 Set Types

Standard Library — set

Complete reference for set and frozenset operations.

https://docs.python.org/3/library/stdtypes.html#set-types-set-frozenset
📋 Copy Module

Standard Library — copy

Shallow and deep copy operations for compound objects.

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

Coding Conventions

Guidelines for loops, comprehensions, and collection usage.

https://peps.python.org/pep-0008/
📝 PEP 274 — Dict Comprehensions

Dictionary Comprehensions

The PEP that introduced dictionary comprehension syntax.

https://peps.python.org/pep-0274/
📝 PEP 3132 — Extended Unpacking

Extended Iterable Unpacking

The PEP that introduced *rest syntax for unpacking.

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

Getting Started

Sections 4 (control flow) and 5 (data structures) cover this lecture’s topics.

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

Learning Python (5th Edition)

Chapters 8–14 cover iteration, lists, dictionaries, tuples, and comprehensions in depth.

Luciano Ramalho

Fluent Python (2nd Edition)

Part II covers sequences, dictionaries, sets, and their protocols. Excellent for understanding Python’s data model.

Brett Slatkin

Effective Python (2nd Edition)

Items 11–18 cover comprehensions, generators, and iteration best practices.