+ 1
How to concatenate a int to a str in python?
sudo-asap says I don't want a whitespace between a int type and a str type so how do I accomplish this without an error, thanks
3 Respuestas
+ 2
Convert the int value to string and then concatenate it with the string value like this:
num=10
name="Jack"
new_name=name+str(num)
+ 1
Lets see your code so we can see exactly what the problem is
+ 1
Ok so the only way to concatenate an int with str is to make the int a str type. Ok thanks.