Search for tag: "statement"

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 18 plays

Lesson 16.7 For-Loops and Testing

Another control-structure means another video on testing. But if you have following the Rule of Numbers, you will discover that you have enough tests for your for-loop. Instead, as we show in this…

From  Hannah Lee on October 19th, 2020 13 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 16 plays

Lesson 16.1 The For-Loop

In this video we introduce a new control-structure: the for-loop. This control structure is specifically designed for processing iterable types like strings, tuples, and lists.

From  Hannah Lee on October 19th, 2020 15 plays

Zoom Sep. 24. Conditionals

In this session we review conditionals, focusing on how we visualize them. This will be important for the second assignemnt.Conditional assignments will not be necessary for Assignment 1. In fact,…

From  Hannah Lee on October 10th, 2020 1 plays

Lesson 15.8 Slice Assignment (OPTIONAL)

This video introduces an advanced topic that is completely optional and will not appear on any exam. Lists don’t just allow us to use a single position in an assignment statement. We can also…

From  Hannah Lee on October 10th, 2020 4 plays

Lesson 15.4 List Assignment

The big advantage that lists have over tuples is that they are mutable.In this video we show how to write assignment statements that modify the contents of a list.

From  Hannah Lee on October 10th, 2020 13 plays

Lesson 14.4 Try-Except and Testing

We have a new control structure, so it is time once again to talk about testing. In this video we revisit the concept of code coverage and show testing a try-except is very similar to testing a…

From  Hannah Lee on October 10th, 2020 13 plays

Lesson 14.3 Try-Except and the Stack

The except-portion of an try-except statement is only executed when there is an error/crash. But, as we have seen, errors can occur anywhere in the call stack. In this video we show how try-except…

From  Hannah Lee on October 10th, 2020 14 plays

Lesson 14.2 Functions with Try-Except

Try-except statements will allow use to write functions that we could not write with conditional statements. In this video, we show how to use try-except as a general programming tool.

From  Hannah Lee on October 10th, 2020 11 plays

Lesson 14.1 Try-Except Statements

In this video we intrduce a new control structure: the try-except statement. As we will see, it looks very similar to an if-else statment with some important differences.

From  Hannah Lee on October 10th, 2020 12 plays

Lesson 13.6 Assert Helpers

Sometimes we absolutely need to enforce all of our preconditions, and we cannot live with the compromises of the previous video. In this video we show how to use top-down design to give us more…

From  Hannah Lee on October 10th, 2020 9 plays

Lesson 13.5 Assert Trade-Offs

Preconditions can get really complicated, and sometimes it is unclear how to enforce all of the preconditions. In this video we talk about why it is okay to break up a precondition and…

From  Hannah Lee on October 10th, 2020 9 plays

Lesson 13.4 Assert Messages

We now know how to do assert statements to create errors. But the error messages are a little cryptic. In this video we talk about how we can do a better job.

From  Hannah Lee on October 10th, 2020 9 plays

Lesson 13.3 Assert Statements

Determining responsibility can get really tedious. In this video, we show how we can responsibility explicit by creating errors on purpose. We introduce the assert statement, which will allow us to…

From  Hannah Lee on October 10th, 2020 10 plays

Lesson 11.5 Object Attributes

Objects are these folders that contain a portfolio of variables. These variables are called attributes. In thie video we talk about how we can access these attributes, or even change them.

From  Hannah Lee on October 2nd, 2020 5 plays