Question: A class Library has an attribute called num _ books, which is the number of books that currently belongs to the library. Given the following

A class Library has an attribute called num_books, which is the number of books that currently belongs to the library. Given the following function,
def buy_books(lib, n):
rec = lib.num_books + n
if rec <6000:
lib.num_books = rec
where the parameter lib is a Library object, the parameter n is an integer.
Suppose a library object ellis currently has 5930 books. What the value of num_books for ellis will be if buy_books(ellis,80) is called?
Group of answer choices
6010
6000
5930
5850

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!