00:01
Okay, good day, ladies and gentlemen.
00:06
Today we're looking at problem number 815 in the great python book.
00:12
And we're looking at the ispn 10 check digit, or finding the ispn check digit.
00:22
So the basic idea is that we're given a ispn number, for instance, something like that.
00:31
This we're given the ispn 10 digits maybe one three zero seven eight nine oops yeah sorry eight eight seven or maybe i do it this way because this is better one two three four five six seven eight nine and we want to find the next digit here so we want to to find the next digit.
01:10
So how do you go about computing it? well, first off, remember that this is a string.
01:17
So this is i.
01:21
So we'll call this string equal to that.
01:27
It's string.
01:29
Okay.
01:30
We're reading in a string here and we apply the formula that we apply the formula d equals to what b1 or maybe we go one times one plus two times two plus three times three you get the idea plus four four times four plus five times five plus six times six plus dot dot dot plus nine times nine and oops nine and then we mod that by eleven then we go mod 11 and of course if d is if if b is is equal to 10, we just return x.
02:45
Otherwise, else we just return d.
02:52
And then we just depend.
02:55
And then we just do string equals to string plus d...