Articles tagged with #python

Intro to CS: Lecture 10 - Lists, Mutability

Topics: List Operations, Mutability: mutation, aliasing, tricky examples with loops over L Lists are mutable. Strings are not. We covered the append function on lists. Convert string to list using list(s), and convert list to string using join. This is all review for me. Functions with side effects can …



Intro to CS: Lecture 9 - Lambda functions, Tuples, and Lists

Topics: Tuples and lists Lambda creates a procedure/function object, but does not bind a name to it. I’ve come across lambda functions throughout my experience so I am familiar with them. Another name for them is anonymous functions. Going over tuples, and variable number of arguments. Came across …



Intro to CS: Lecture 8 - Functions as Objects

Topics: Functions: environments, scope, functions as objects This is also review for me. Another thing I noticed about this course is that a lot of math examples are used. Math and CS/Programming go hand in hand so I’m not surprised by this. Also, this is MIT, so students …



Intro to CS: Lecture 7 - Decomposition, Abstraction, Functions

Topics: Functions: decomposition, abstraction, specifications Big idea: Apply abstraction (black box) and decomposition (split into self-contained parts) to programming. Already know about functions, decomposition, and abstraction, so this lecture is review to me. The instructor is now teaching how to come up with code for say a quiz. They say …



Intro to CS: Lecture 6 - Bisection search

Topics: Simple Algorithms: bisection search, Newton-Raphson This is basically binary search. Straightforward algorithm and review for me. I learned something new. Or something I probably learned before but forgot about. The square root of a number between 0 and 1 is going to be greater than itself. Compared different algorithms …



Intro to CS: Lecture 5 - Floats and Approximation Methods

Topics: Simple Algorithms: approximation method, floats One thing I observed so far is that this course is not teaching a systematic way on how to come up with algorithms. By coming up with algos, I mean the process of taking a well-defined problem, its steps, and translating it into code …



Intro to CS: Problem Set 1

I was able to do part A and B in less than 1 hour. Part C, however, I will have to watch the related lectures because I need to know the bisection search algorithm, which I don’t know off the top of my head. Part A and B were …



Intro to CS: 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 problems. When the set of potential solutions is enumerable, exhaustive enumeration is guaranteed …



Intro to CS: Lecture 3 - Iteration

Going over while and for loops. This is basic stuff for me. Watching video at 2x speed. Done watching, no new things learned. Onward to lecture 4.



Intro to CS: Lecture 2 - Strings, Input/Output, Branching

This blog post might be really short as I don’t feel like repeating things that I already know. Will keep watching the lecture to see if anything interesting pops up. Watching lectures on 2x speed. Topics: Core Elements of Programs: strings, input/output, f-strings, operators, branching, indentation. I already …