What to do to correct the error written below:

Peter Pearson pkpearson at nowhere.invalid
Tue Apr 12 11:17:34 EDT 2022


On Tue, 12 Apr 2022 04:56:22 -0700 (PDT), NArshad wrote:
>
>>By looping over elements in "books" and incrementing counter i,
>>which is used as an index both for "books" and for "students",
>>you will produce an error whenever the number of books exceeds
>>the number of students.  Is there some reason to assume that the
>>number of books cannot exceed the number of students?
>
> Since this is an online library the number of students can be any when
> compared to number of books or the number of students has nothing to
> do with the number of books.

1. The code assumes that the number of books does not exceed the
   number of students.

2. You report that the number of students has nothing to do with
   the number of books.

3. Therefore we have identified an erroneous assumption in the code.

Mystery solved.

-- 
To email me, substitute nowhere->runbox, invalid->com.


More information about the Python-list mailing list