Concatenation of Strings and variable results


I really want the end of my battleship game to say "Game Over. The ship was located at ship_col, ship_row." I have the game fully functioning, I just think it would be better if I was able to add in those numbers.

Essentially, I would like to know how to turn the results from variables like ship_col and ship_row into strings so I can add them into my finishing sentence.


You can use str().

b = str(123)
# b is now equal to "123"