6.100L Introduction to CS and Programming Using Python
6.100L Introduction to CS and Programming Using Python (Fall 2022, MIT OCW). Instructor: Dr. Ana Bell. This subject is aimed at students with little to no programming experience. It aims to provide students with an understanding of the role computation can play in solving problems. It also aims to help students, regardless of their major, feel justifiably confident in their ability to write simple programs that allow them to accomplish useful goals. The class will use the Python 3 programming language. (from ocw.mit.edu)
Lecture 04 - Loops over Strings, Guess-and-Check, and Binary |
This lecture explains iteration in simple programs like guess-and-check, binaries, and fractions in Python. Loops can iterate over any sequence of values including a range for numbers or a string. Guess-and-check provides a simple algorithm for solving problems. When the set of potential solutions is enumerable, exhaustive enumeration is guaranteed to work (eventually). Binary numbers help us understand how the machine works. Converting to binary will help us understand how decimal numbers are stored.
Go to the Course Home or watch other lectures: