Course or collection
Introduction to CS and Programming using Python
MIT OpenCourseWare · 26 catalogue entries
MIT OpenCourseWare · Fall 2022
Original course and syllabus ↗MIT 6.100L Introduction to CS and Programming using Python, Fall 2022
Lecture 1: Introduction to CS and Programming Using Python
An introduction to what computation is, Python basics, mathematical operations, and Python variables and types. We explore Python objects and Python programs.
Lecture 2: Strings, Input/Output, and Branching
This lecture discusses the core elements of programs: strings, input/output, f-strings, operators, branching, and indentation. Big idea: Debug early, debug often. Write a little and test a little. Don’t write a complete program at once. It introduces too many
Lecture 3: Iteration
An introduction to control flow and iteration through loops. Looping mechanisms include while and for loops . Lots of syntax today, be sure to get lots of practice! While loops loop as long as a condition is true and you need to make sure you don’t enter an in
Lecture 4: 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 problem
Lecture 5: Floats and Approximation Methods
An introduction to simple algorithms, float types, and approximation methods. Floating point numbers introduce challenges as they can’t be represented in memory exactly. Approximation methods use these floating numbers.
Lecture 6: Bisection Search
This lecture discusses the simple algorithms of bisection search and Newton-Raphson. Bisection search takes advantage of the properties of the problem. Decomposition and abstraction make code easy to create, modify, maintain, and understand.
Lecture 7: Decomposition, Abstraction, and Functions
An introduction to functions and their decomposition, abstractions, and specifications. Functions allow us to suppress detail from a user and capture computation within a black box. A programmer writes functions with 0 or more inputs and something to return. A
Lecture 8: Functions as Objects
This lecture further explores functions and their scopes and environments as well as functions as objects. Functions are first-class objects that have a type and can be assigned as a value, used as an argument for another procedure, or returned from another pr
Lecture 9: Lambda Functions, Tuples, and Lists
Prof. Bell discusses the variable types tuples and lists and how to use lambda functions. Lambda functions are useful when you need a simple function once. Tuples and lists are indexable sequences of objects.
Lecture 10: Lists and Mutability
This lecture explores list operations and mutability: mutation, aliasing, and tricky examples with loops over L. Lists and tuples provide a way to organize data that naturally supports iterative functions. Tuples are useful when you have data that doesn’t need
Lecture 11: Aliasing and Cloning
This lecture discusses aliasing, cloning, list comprehensions, and the difference between shallow copies and deep copies with mutable elements.
Lecture 12: List Comprehension, Functions as Objects, Testing, and Debugging
Lecture 12 continues with more functions as objects, keyword arguments, default arguments, and types of debugging: glassbox / black box testing with examples.
Lecture 13: Exceptions and Assertions
An introduction to the concepts of exceptions and assertions, how to handle exceptions, and how to raise assertion errors.
Lecture 14: Dictionaries
Introduces dictionaries, their keys and values, their mutability, and iteration over a dictionary with examples. Dictionaries have entries that map a key to a value. Keys are immutable/hashable and unique objects while values can be any object. Dictionaries ca
Lecture 15: Recursion
Recursion is a programming method and a way to divide and conquer. A problem is broken down into a base case and a recursive step.
Lecture 16: Recursion on Non-numerics
The recursion procedure from this lecture can be applied to any indexable ordered sequence. The same idea will work on problems involving strings or tuples.
Lecture 17: Python Classes
Prof. Bell discusses how classes make it easy to reuse code. Each class has a separate environment (no collision on function names) and inheritance allows subclasses to redefine or extend a selected subset of a superclass’s behavior.
Lecture 18: More Python Class Methods
This lecture discusses decomposition and abstraction at work with Python classes. Bundling data and behaviors means you can use objects consistently. Dunder methods are abstracted by common operations, but they’re just methods behind the scenes!
Lecture 19: Inheritance
This lecture describes how to add layers of complexity through hierarchies and child classes which inherit data and methods from parent classes. Like functions, classes are a mechanism for decomposition and abstraction in programming.
Lecture 20: Fitness Tracker Object-Oriented Programming Example
Prof. Bell uses fitness trackers as an example to explain the difference between implementing a new object type using a class and using the object in code and the two different coding perspectives. Object-oriented programming is a powerful tool for modularizin
Lecture 21: Timing Programs and Counting Operations
Learn to evaluate programs by measuring with a timer, counting the operations, and abstracting the notion of order of growth.
Lecture 22: Big Oh and Theta
This lecture explores how to compare the efficiency of algorithms by using notation that describes growth independent of machine or specific implementation. It shows how to use Theta to describe asymptotic order of growth as well as upper and lower bounds.
Lecture 23: Complexity Classes Examples
This lecture looks at complexity classes to compare the efficiency of algorithms, lower order of growth, and use Θ for an upper and lower (“tight”) bound.
Lecture 24: Sorting Algorithms
This lecture discusses different kinds of sorting and the levels of complexity of each algorithm. The sorting algorithms discussed are BOGO sort, bubble sort, selection sort, and merge sort.
Lecture 25: Plotting
Sooner or later, everyone needs to produce plots because they help us visualize data to see trends and pose computational questions to probe. Python libraries for plotting and numerical and stochastic computation are explored.
Lecture 26: List Access, Hashing, Simulations, and Wrap-Up
Prof. Bell wraps up the course by talking more about lists and how and why to use hashing, and gives some simulation examples.