CJCoding With Joseph
15free / daySign inCreate account

Add A Book To The Library

A Library is not a kind of Book; it HAS a list of them in the attribute books. Write the body of add_book so it appends the given book object to that list. Do NOT write a main block or any top-level test code; the tests construct the class. Input: two lines, each a title, which the tests turn into Book objects and add in order; they then print how many books the library holds and each title on its own line.

Expected Output:

2
Dune
Emma

= newline. The output ends with a newline — print one after the last line.

Hints2 available
Topics:
Classes
📥 Auto-Input:
Dune\nEmma\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.