6.100L | Fall 2022 | Undergraduate

Introduction to CS and Programming using Python

Lecture 4: Loops over Strings, Guess-and-Check, Binary

Topics: Iteration, Simple Programs: guess and check, binary, fractions

Lecture Notes

Lecture 4: Loops over Strings, Guess-and-Check, Binary

Lecture 4 Code

Readings

Ch 3.1, 3.3

Finger Exercise Lecture 4

Assume you are given a positive integer variable named N. Write a piece of Python code that finds the cube root of N. The code prints the cube root if N is a perfect cube or it prints error if N is not a perfect cube. Hint: use a loop that increments a counter—you decide when the counter should stop.

6.100L Finger Exercises Lecture 4 Solutions

Course Info

Instructor
As Taught In
Fall 2022
Learning Resource Types
Lecture Videos
Lecture Notes
Problem Sets
Programming Assignments with Examples
Readings
Recitation Notes