CCCPaste

3.Statistics

products = {}

command = input()

while command != "statistics":
    command_split = command.split(": ")
    product = command_split[0]
    quantity = int(command_split[1])
    
    if product not in products:
        products[product] = 0
        
    products[product] += quantity
    
    command = input()
    
print("Products in stock:")
for (product, quantity) in products.items():

    print(f"- {product}: {quantity}")
    
print(f"Total Products: {len(products.keys())}")
print(f"Total Quantity: {sum(products.values())}")