def make_pizza(size, *toppings): """打印顾客点的所有配料""" print("\nMaking a {}-inch pizza with the following toppings:".format(size)) for topping in toppings: print(f"-{topping}") make_pizza(16, 'pepperoni') make_pizza(12, 'mushrooms', 'green peppers', 'extra cheese')
Making a 16-inch pizza with the following toppings: -pepperoni Making a 12-inch pizza with the following toppings: -mushrooms -green peppers -extra cheese