Search for tag: "string"

Zoom Sep. 17. Strings

In this class we review how to process text in Python. These techniques we are reinforcing will be used in the first assignment.As part of today’s class, we have provided some additional demo…

From  Hannah Lee on September 24th, 2020 0 plays

Lesson 8.2 Test Cases

Many students in this course find that coming up with good test cases is far harder than writing code. That is because you have to design your test cases from the specification, before seeing any…

From  Hannah Lee on September 24th, 2020 1 plays

Lesson 7.4 Preconditions Categories

In this video, we break our preconditions up into categories. The primary reason for this is to help us analyze a specification. It will also become extremely imporant when we talk about enforcement…

From  Hannah Lee on September 24th, 2020 0 plays

Lesson 7.3 Preconditions

The one thing that we have not talked about yet are the preconditions in a specification. However, as this video shows, they are arguably the most important part of the specification. They are what…

From  Hannah Lee on September 24th, 2020 0 plays

Lesson 6.5 String Processing

The focus of the first assignment will be to write functions that take a string as input and produce a string as output. We sometimes call this (informally) string processing. This can be a daunting…

From  Hannah Lee on September 16th, 2020 5 plays

Lesson 6.4 Advanced String Methods

In the previous video, we showed how to call a string method if it had only one argument – the string. In this video we show you how to call arbitrary string methods, which can have many…

From  Hannah Lee on September 16th, 2020 4 plays

Lesson 6.3 String Methods

Strings do not have a lot of functions associated with them. Instead, strings have methods. As we see in this video, methods behave almost exactly like functions, except that the syntax for calling…

From  Hannah Lee on September 16th, 2020 5 plays

Lesson 6.2 String Slicing

Strings have a fundamental property that is not present in the other types so far. You can cut up a string into smaller bits or substrings. This is know as string slicing, and it is the focus of the…

From  Hannah Lee on September 16th, 2020 5 plays

Lesson 6.1 Advanced String Expressions

We have seen that we create a string by writing it between two quotes. However, the quotes are never part of the string. What if we want the quotes to be part of the string? In this video we tackle…

From  Hannah Lee on September 16th, 2020 6 plays

Lesson 5.2 Procedures

In this video, we show you how to define a procedure in the Python interactive shell. Recall that a procedure is a function that is used as a command.

From  Hannah Lee on September 11th, 2020 4 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 4 plays

Lesson 3.2 String Functions

Strings are very powerful type that we will use in the first major assignment. In this video we introduce the three main string functions that you should be aware of.

From  Hannah Lee on September 9th, 2020 3 plays

Lesson 2.4 Dynamic Typing

If you have programmed before (and it is okay if you have not), you may be used to variables having the restriction that they can only contain specific types. This is not the case in Python, and that…

From  Hannah Lee on September 7th, 2020 2 plays

Lesson 1.7 Mixed Expressions

For the most part, operations are used to combine two expressions of the same type. Adding together two ints is different from adding together two strings. In this video we see what happens when we…

From  Hannah Lee on September 4th, 2020 3 plays

Lesson 1.5 String Expressions

Strings are the type for text data. We will go into much more depth with this type in a later module. In this video, we just introduce the basics to complete our overview of Python types.

From  Hannah Lee on September 4th, 2020 2 plays