Basic borrow
Input
l = sample_library(); l.borrow('m1', 'ISBN-001')
Output
True
Member m1 successfully borrows ISBN-001 because copies are available.
Full lesson preview
Model a small library using composition: Books, Members, and a Library that manages borrow/return records and availability.
Problem statement
Task
Examples
Input
l = sample_library(); l.borrow('m1', 'ISBN-001')
Output
True
Member m1 successfully borrows ISBN-001 because copies are available.
Input format
Output format
Constraints
Samples
Input
l = sample_library(); l.borrow('m1','ISBN-002'); l.return_book('m1','ISBN-002'); l.borrow('m2','ISBN-002')
Output
True
m1 borrows the single copy of ISBN-002, returns it, then m2 can borrow it: final borrow succeeds and returns True.