Search for tag: "arguments"

Lesson 20.9 Optional Arguments

Unlike other programming languages, a Python class has only one constructor, If we want to give the user more flexibility when creating objects, we should make certain arguments optional. In this…

From  Hannah Lee on October 27th, 2020 1 plays

Lesson 20.7 Intializers

In this video, we introduce the most important method definition in any class: the initializer. The initializer is responsible for creating all the attributes so that the user does not need to worry…

From  Hannah Lee on October 27th, 2020 2 plays

Lesson 20.5 Method Definitions

In addition to attributes, objects also have methods. In this video, we show how to add a method definition to a class. For the most part, it is as simple as indenting a function definition inside of…

From  Hannah Lee on October 27th, 2020 2 plays

Lesson 20.2 Class Visualization

Now that you know how to define a class, you need to understand how Python processes the definition. In this video, we see that Python handles it in much the same way, that it does function…

From  Hannah Lee on October 27th, 2020 1 plays

Lesson 19.8 Keyword Expansion (OPTIONAL)

This video introduces an advanced topic that is completely optional and will not appear on any exam. Keyword expansion is the dictionary version of tuple expansion. It is used in modules like Kivy to…

From  Hannah Lee on October 27th, 2020 0 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 3 plays

Lesson 16.4 Range-Based For-Loops

Strings, lists, and tuples are not the only iterable types. In this video we introduce the range function, which creates another iterable value. This is going to allow us to do several things that we…

From  Hannah Lee on October 19th, 2020 18 plays

Lesson 13.2 Error Responsibility

When we introduced specifications, we talked about responsibility; if there is a problem with a function, it is either the fault of the definer or the caller. In this video, we show how we read an…

From  Hannah Lee on October 10th, 2020 8 plays

Lesson 12.5 Functions as Variables

If function definitions are objects, then that means we can compute with them like any other object. In this video we show what happens when we assign a function definition to a variable, or why we…

From  Hannah Lee on October 2nd, 2020 11 plays

Lesson 12.4 Functions in Memory

We know what happens when we call a function. But as we show in this video, Python also does something very important when we define a function. It has to store the definition somewhere.

From  Hannah Lee on October 2nd, 2020 10 plays

Lesson 11.8 Object Methods

Objects have an interesting feature that we saw before we strings: they have methods in addition to functions. In this video we talk about those methods, and how they differ from string methods.

From  Hannah Lee on October 2nd, 2020 7 plays

Lesson 11.7 Mutable Functions

In the past if we wanted to do any significant computation, we needed a a fruitful function. Procedures are limited to testing or printing stuff out on the screen. But in this video we show how we…

From  Hannah Lee on October 2nd, 2020 6 plays

Lesson 9.7 Conditionals & Local Variables

Python is unlike other languages in that it does not have a traditional notion of scope. You can create a variable inside of conditional, but still access that same variable outside of the…

From  Hannah Lee on September 24th, 2020 3 plays

Zoom Sep. 15. User-Defined Functions

In this class we will review how functions are defined, and how we visualize their execution.We will spend more of the class talking about visualization than how to write function definitions in…

From  Hannah Lee on September 16th, 2020 7 plays

Lesson 3.4 Python Documentation

While this new video/lecture format is allowing us to show you things we could not cover in year’s past, there is a limit to how much we can show you. Sometimes you are just going to need to…

From  Hannah Lee on September 9th, 2020 9 plays

Lesson 3.1 Built-In Functions

The easiest functions to use in Python are those that are built into it. They are listed on the Python Documentation page. In this video we examine some of these and show the syntax for how to use…

From  Hannah Lee on September 9th, 2020 6 plays