make me a program list of books
- User
make me a program list of books
- Assistant
Certainly! Here's a list of programming books that cover various languages and concepts:
- "The Pragmatic Programmer" by Andrew Hunt and David Thomas
- "Clean Code: A Handbook of Agile Software Craftsmanship" by Robert C. Martin
- "Introduction to the Theory of Computation" by Michael Sipser
- "Code Complete: A Practical Handbook of Software Construction" by Steve McConnell
- "Head First Design Patterns" by Eric Freeman, Elisabeth Robson, Bert Bates, Kathy Sierra
- "Effective Java" by Joshua Bloch
- "Design Patterns: Elements of Reusable Object-Oriented Software" by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides
- "Refactoring: Improving the Design of Existing Code" by Martin Fowler
- "Cracking the Coding Interview" by Gayle Laakmann McDowell
- "JavaScript: The Good Parts" by Douglas Crockford
- "Python Crash Course" by Eric Matthes
- "Eloquent JavaScript: A Modern Introduction to Programming" by Marijn Haverbeke
- "Learning Python" by Mark Lutz
- "Algorithm Design Manual" by Steven S. Skiena
- "The C Programming Language" by Dennis Ritchie and Brian Kernighan
- User
make me a book list program with python code
- Assistant
Certainly! Here's a simple Python program that allows you to create and manage a list of books:
book_list = [] def add_book(): title = input("Enter book title: ") author = input("Enter author name: ") publication_year = input("Enter publication year: ") book = { "title": title, "author": author, "year": publication_year } book_list.append(book) print(f"\n'{title}' by {author} added to the book list.\n") def display_books(): if len(book_list) == 0: print("The book list is empty.\n") else: print("Book List:\n") for book in book_list: print(f"Title: {book['title']}") print(f"Author: {book['author']}") print(f"Publication Year: {book['year']}\n") def remove_book(): if len(book_list) == 0: print("The book list is empty.\n") return title = input("Enter the title of the book to remove: ") for book in book_list: if book["title"].lower() == title.lower(): book_list.remove(book) print(f"\n'{title}' has been removed from the book list.\n") return print(f"\n'{title}' was not found in the book list.\n") while True: print("---------- Book List Program ----------") print("1. Add a book") print("2. Display all books") print("3. Remove a book") print("4. Exit\n") choice = input("Enter your choice (1-4): ") if choice == "1": add_book() elif choice == "2": display_books() elif choice == "3": remove_book() elif choice == "4": print("Thank you for using the book list program.") break else: print("Invalid choice. Please try again.\n") - User
create a book list program in python that has the book title, book name, author, price, book year
- Assistant
Certainly! Here's an updated version of the book list program in Python that includes the book title, author, price, and year.
book_list = [] def add_book(): title = input("Enter book title: ") author = input("Enter author name: ") price = float(input("Enter book price: ")) year = input("Enter publication year: ") book = { "title": title, "author": author, "price": price, "year": year } book_list.append(book) print(f"\n'{title}' by {author} added to the book list.\n") def display_books(): if len(book_list) == 0: print("The book list is empty.\n") else: print("Book List:\n") for book in book_list: print(f"Title: {book['title']}") print(f"Author: {book['author']}") print(f"Price: ${book['price']}") print(f"Publication Year: {book['year']}") print() def remove_book(): if len(book_list) == 0: print("The book list is empty.\n") return title = input("Enter the title of the book to remove: ") for book in book_list: if book["title"].lower() == title.lower(): book_list.remove(book) print(f"\n'{title}' has been removed from the book list.\n") return print(f"\n'{title}' was not found in the book list.\n") while True: print("---------- Book List Program ----------") print("1. Add a book") print("2. Display all books") print("3. Remove a book") print("4. Exit\n") choice = input("Enter your choice (1-4): ") if choice == "1": add_book() elif choice == "2": display_books() elif choice == "3": remove_book() elif choice == "4": print("Thank you for using the book list program.") break else: print("Invalid choice. Please try again.\n")