Python Tutorial

Loops and List Comprehensions

« Previous | Next »

Before starting these problems, please read:

The problems in the table below are taken from the 6.01 Python Tutor, an interactive environment that is not available on OCW. Do not try to answer these questions in the PDF files; answers will not be checked, and cannot be submitted.

5.1.1 More expressions (PDF)
5.1.2 Ranger (PDF)
5.2.1 From point A to point B (PDF)
5.2.2 Distance from point to line (PDF)
5.3.1 Multiple times (PDF)
5.3.2 Every other (PDF)
5.3.3 Cat 6 (PDF)
5.3.4 Home on the range (PDF)
5.3.5 The mean of a list of numbers (PDF)
5.3.6 Standard deviation (PDF)
5.3.7 Dictionaries (PDF)
5.3.8 Slice of Pi (PDF)
5.3.9 Polly (PDF)
5.3.10 As close as necessary (PDF)

« Previous | Next »

Learning Resource Types
Lecture Videos
Recitation Videos
Problem Sets
Exams with Solutions
Lecture Notes
Instructor Insights
Programming Assignments