prog9_18.py

products = {}
while True:
    name = input("商品?")
    if name == "":
        break
    price = input("値段?")
    if price == "":
        del products[name]
    else:
        products[name] = int(price)
    print(f"商品一覧:{products}")
print("終了しました!")

# プログラム9-18(商品と値段の一覧 ②:削除機能つき)