Dealing with logical errors Python 3


show more Dealing with logical errors provides you with in-depth training on Developer. Taught by Bill Weinman as part of the Python 3 Essential Training show less
please wait ...

Dealing with logical errors

Sometimes when you run into errors in our code. It's not a syntax error. It's not a runtime error. It's just that the code doesn't quite do what it was that we had intended for it do. These things are often also caused by typos. So let's make a working copy of, incrange-errors.py and we will call that incrange-errors-working.py. This is our inclusive range method from another example in this course.

There is the code, and you will see that it calls it down here, and we will just run it and see what happens. Well, nothing happens. That's not a good sign. So why would nothing happen? Well, what's supposed to happen? The object gets initialized and it gets constructed with these parameters, a start, a stop and a step of 4, 25 and 3, and then it gets printed out by using the object as an iterator, and we can see right here, here is the iterator function.

It's go a yield here, which makes it a generator, so that looks like it should work. We have the start, stop and s...

Dealing with logical errors
Video duration: 4m 22s 6h 36m Beginner

Viewers:

Dealing with logical errors provides you with in-depth training on Developer. Taught by Bill Weinman as part of the Python 3 Essential Training

Subjects:
Developer Web
Software:
Python
Author:
please wait ...