# This code implements a Library application that lets user store and # retrieve books from a shelf. # # Tasks: # - Fix storeNewBook, and getBook # - Can you add a way to see all books in the library? # - Make a way to update a book? # - Make sure you cannot add a book with the same title (using compare?) # def storeNewBook(): 'Store a new book in the library' print 'Store New Book' # Ask the user for the input needed to create a book # Create the book # Add the book into the shelf based on the title (make sure to lowercase the title) def getBook(): 'Get information about a book from the library' print 'Get Book' # Get the title we want to see # Look up the book in the library # Print out the book def updateBook(): 'Get the book from the library and update pieces of it' print 'UpdateBook' def main(): choice = 'z' while choice != 'q': print ''' ************************ MENU ------------------------ (s)tore a new book (g)et book info (u)pdate book info (q)uit ************************ ''' choice = raw_input('Enter choice:') if choice == 's': storeNewBook() elif choice =='g': getBook() elif choice =='u': updateBook() elif choice == 'q': None # Do nothing, but we know this was a valid option else: print '\n\nSorry, %s is not a valid option \n\n' %(choice) main()