Search for tag: "answer"

Lesson 26.7 Convergent While-Loops

In this video we show one of the most powerful while-loop techniques: computing to convergence. Convergence is a concept that most students learn in Calculus, and so we will use a little Calculus in…

From  Hannah Lee on November 12th, 2020 3 plays

Lesson 26.4 While-Loop Patterns

In this video we introduce two new patterns for while-loops: using a goal condition and using a boolean tracking variable. We see how these patterns allow us to write functions that we could never…

From  Hannah Lee on November 12th, 2020 3 plays

Zoom Nov. 5. Inheritance

In this presentation, we continue with several of the classes that we worked on last time. But this time, we create subclasses of them.On the exam, the class question will always be a two-parter. One…

From  Hannah Lee on November 8th, 2020 3 plays

Lesson23.4 The is Operator

As we saw in the previous video, we cannot trust == if we need to test if two variables refer to the same object folder. In this video we show an alternative operator is, which is safe to use because…

From  Hannah Lee on November 8th, 2020 30 plays

Lesson 23.3 Object Equality

Previously when we compared objects, we compared them attribute-by-attribute. That is because the meaning of == on objects is less clear. As we show in this video, that is because equality (and the…

From  Hannah Lee on November 8th, 2020 42 plays

Zoom Oct. 20. Recursion

Recursion is a powerful programming tool and one of the fundamental principles of computer science. It is used in many advanced algorithms.In this session, we will just focus on divide-and-conquer,…

From  Hannah Lee on October 27th, 2020 10 plays

10.26.20 Theory Seminar - Fall 2020 Noah Stephens-Davidowitz, Cornell University

Zoom Recording ID: 97470844866 UUID: PYLNpwbFSyGitoxWP/llhA== Meeting Time: 2020-10-26T20:05:46Z

From  Jordan Staiti on October 26th, 2020 5 plays

Zoom Oct. 15. For-Loops

In this session, we review the for-loop, which is the next control structure. This is the last control structure we will need for a while.For-loops are pretty easy to use in Python, and most students…

From  Hannah Lee on October 19th, 2020 6 plays

Zoom Oct. 13. Lists (and Sequences)

In this session we review the two new sequence data types: tuples, and lists. This is the last material on the first prelim.For the most part these are similar to strings, and so we will do a lot of…

From  Hannah Lee on October 19th, 2020 3 plays

Lesson 17.6 Divide and Conquer Visualization

Just because you know how to write a divide-and-conquer algorithm does not mean you understand it. In this video we try to improve our understanding by visualizing divide-and-conquer. When we do this…

From  Hannah Lee on October 19th, 2020 41 plays

Lesson 17.5 Divide and Conquer Design

Now that we understand divide-and-conquer, it is type to implement it in Python. In this video we show you a three-step sequence for writing a function definition using this technique.

From  Hannah Lee on October 19th, 2020 42 plays

Lesson 17.4 Divide and Conquer

Recursion has many, many uses. But one of the most popular applications is divide-and-conquer. In this video we introduce this new concept and show how we will use to solve several problems on…

From  Hannah Lee on October 19th, 2020 44 plays

Lesson 17.2 Recursive Functions

In this video we show how to take recursive definitions from mathematics and implement them in Python. To do this, we will need to have a function call itself in its own definition.

From  Hannah Lee on October 19th, 2020 41 plays

Lesson 16.8 Tuple Expansion (OPTIONAL)

This video introduces an advanced topic that is completely optional and will not appear on any exam. You might have noticed that some functions, like max can take an arbitrary number of arguments. In…

From  Hannah Lee on October 19th, 2020 8 plays

Lesson 16.2 For-Loop Design

In this video we show how to use for-loops in function definitions. In particular, we show that we go from a specification to code that uses a for-loop.

From  Hannah Lee on October 19th, 2020 28 plays