Advertisement
Guest User

Untitled

a guest
Apr 30th, 2025
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. book_list = []
  2.  
  3. user_input = input('Welcome! Press Enter to continue or Exit to Quit: ')
  4.  
  5. while user_input != 'exit':
  6. user_input = input('How can I help you?: ').lower()
  7.  
  8. if user_input == 'library':
  9. for book in book_list:
  10. print(book_list)
  11. continue
  12.  
  13.  
  14. if user_input == 'add book':
  15. title = input('Book Title: ')
  16. book = title
  17. author = input('Author: ')
  18. year = input('Publication Year: ')
  19. genre = input('Genre: ')
  20. new_book = [f'Title: {title}, Author: {author}, Year: {year}, Genre: {genre}']
  21. book_list.append(new_book), print('Library Updated!')
  22.  
  23.  
  24.  
  25. if user_input == 'remove book':
  26. remove_book = input('which book?')
  27. if remove_book in book_list:
  28. for book in book_list:
  29. book_list.remove(remove_book)
  30. print('Book Removed!')
  31.  
  32.  
  33. if user_input == 'book count':
  34. print('book_count')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement