# L-24 MCS 260 Mon 8 Mar 2010 : class Book class Book: """ Objects of the class Book represent books. """ def create(self): "Prompts the user for number and title." self.key = input('Give number : ') self.title = raw_input('Give title : ') self.available = True return self def show(self): "Shows content of the book." s = '%2d' % self.key s += ': ' + self.title if self.available: s += ' is available' else: s += ' is not available' print s def check(self): "Returns the status of the book." return self.available def change(self): "Flips the status of the book." self.available = not self.available