def __getitem__(self, i):
    return self.books[i]

def __iter__(self):
    return iter(self.books.values())
library = Library()
library['title']
for book in library:
    pass
How do I use __getitem__ and __iter__ and return values from a dictionary?