Why is that when I have just print("We sell " + str(num_pizza) I get part of the needed output (W sell # different types of pizza!) but when I attempt to add the next needed part? Thanks in advance
Yes thank you seraph, I had to remove one of the parentheses from the num_pizzas list and close the print statement. seems like is always the smallest adjustments that throws the code off, thank you again.
It works because it is a comma separated list, akin to a tuple which can be heterogeneous (having mixed types). This a non-standard approach to printing mixed data types without the need to re-cast to str type.
Personally, I wouldn’t make a habit of using that format for printing. Better if it is all one type, in this case, str.
print (f"We sell {num_pizzas} different kinds of pizza!")
Note that above we used the newest form of output formatting, the f-string.