コード例 #1
0
            print("1. Add inventory")
            print("2. Decrease inventory")
            print("3. Change price")
            print("4. Leave everything how it is")

            menu_choice = int(input("> "))

            if menu_choice == 1:
                print("You chose to add inventory")
                addition = input("How many books did we add: ")
                textbook_1.add_inventory(addition)
                print(textbook_1.quantity_in_inventory)
            elif menu_choice == 2:
                print("You chose to decrease inventory")
                lose = input("How many books did we sell: ")
                textbook_1.decrease_inventory(lose)
                print(textbook_1.quantity_in_inventory)
            elif menu_choice == 3:
                print("You chose to change the price")
                print(f"The current price is: ${textbook_1.price}")
                textbook_1.price = float(input("The price is now: $"))
            elif menu_choice == 4:
                print("You chose to leave this book as it is.")
            else:
                print("Invalid choice")
    elif book_choice == 2:
        while menu_choice != 4:
            print("Please chose the number to indicate which option you would like to choose")
            print("1. Add inventory")
            print("2. Decrease inventory")
            print("3. Change price")