Python Tutorial

Using if, else, and while

« 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.

3.1.1 If statements (PDF)
3.1.2 Compare (PDF)
3.1.3 Arithmetic if (PDF)
3.1.4 Clipping shears (PDF)
3.1.5 Clip clop (PDF)
3.2.1 Multiple times (PDF)
3.2.2 Multiple times, again (PDF)
3.2.3 A la mod (PDF)
3.2.4 Muad-div (PDF)
3.2.5 Primo (PDF)
3.2.6 Powers of 2 (PDF)
3.2.7 Perfectly square (PDF)

« Previous | Next »

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