Why is `str()` Necessary for Concatenation Here?


#1

Hi, I was going over the comments and I still have a question.
why, when i write big_string = "The product was " + X(product))
and instead of the X I put float / int, it says I have an error, but when I write (instead of the X) str - it works perfectly fine.

Thanks!!


Why does my code give a TypeError when I press Run?
#2

obviously, if you want to make a bigger string using concatenation both parts should be string, which is why you get an error when one part is an integer or a float