Search for tag: "print"

Lesson 29.4 The yield Statement

While generators are coroutines, the communication only goes one way: from the child to the calling parent. In this video we show how to reverse this communication, passing down information from the…

From  Hannah Lee on December 3rd, 2020 35 plays

Lesson 26.2 While-Loop Traces

While-loops can do everything that a for-loop can (and more) but they are much harder to use. That is why, in this video, we talk about how to debug a while-loop before we talk about how to write…

From  Hannah Lee on November 12th, 2020 38 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 37 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 20 plays

Lesson 10.7 Multifunction Debugging

Top-down design simplifies the design of code, but it can make debugging a little more complicated. Now bugs are potentially spread across multiple functions. In this video we look at an extended…

From  Hannah Lee on October 2nd, 2020 13 plays

Lesson 10.4 Iterative Testing

We made very sure that you had learned about testing before you started on your first assignment. That is because we want you testing while you are activtely writing your code, and not waiting until…

From  Hannah Lee on October 2nd, 2020 12 plays

Lesson 9.9 Tracing Conditionals

Now that program structure and program flow are different, debugging is going to get a lot harder. In this video we introduce a new element of white box testing – the trace. You will need to…

From  Hannah Lee on September 24th, 2020 8 plays

Lesson 9.3 If-Else Statements

In this video we introduce the if-else statement. It is like the if statement, except that you now chose between two options.

From  Hannah Lee on September 24th, 2020 10 plays

Lesson 9.2 If Statements

In this video, we introduce this simplest form of conditional statement, the ifstatement. It allows us to skip over code if we do not wish to execute it.

From  Hannah Lee on September 24th, 2020 9 plays

Lesson 8.5 Debugging

Testing is not the same as debugging, but it is the correct first step. In this video, we show how to take the next step to isolate and remove errors in your code.

From  Hannah Lee on September 24th, 2020 13 plays

Lesson 8.4 Test Procedures

As our modules get more complicated, with more an more function definitions, our test scripts will get more complicated as well. In this video we show how to organize our test scripts by putting the…

From  Hannah Lee on September 24th, 2020 14 plays

Lesson 8.3 Test Scripts

A good testing plan has many, many test cases, and it can be really tedious to keep testing a function. That is why it would be ideal if we could automate the process. In this video, we introduce the…

From  Hannah Lee on September 24th, 2020 17 plays

Lesson 5.3 Function Modules

In the previous video, we wrote a function definition in the interactive shell. In this video, we write it in a module. We show how this changes things when you call the function.

From  Hannah Lee on September 11th, 2020 17 plays

Lesson 5.4 Fruitful Functions

In this video we show how to define the definition of a fruitful function (a function that can be used as an expression). It requires a new type of command: the return statement.

From  Hannah Lee on September 11th, 2020 18 plays

Lesson 4.6 Interactive Scripts

Right now, we do not know a lot of Python commands, and so our scripts are pretty boring. But we can make them a lot more interesting with a function that we have already seen: the input function. In…

From  Hannah Lee on September 9th, 2020 15 plays

Lesson 4.5 Script Visualization

In this video, we introduce the Python Tutor. While this tool will be incredibly important when we start discussing some of the more advanced topics in this course, we can already start using it to…

From  Hannah Lee on September 9th, 2020 13 plays