Len's Slices lists project question

Is there a reason to do:
"My age is " + str(my_age)
instead of:
print(“We sell”, num_pizzas, “different kinds of pizza!”)

I find it easier to do the latter.

Readability and style is what matters at the end of the day.
Once you learn f-strings it’s hard to go back, since you can write:

print(f"My age is {my_age}")

but there are still occasions where string format makes sense. Particularly when you want multiple instances of a given variable

print("My age is {}".format(my_age))
2 Likes