+ 1

Please is it possible to add int or float to string

int +str

9th Jan 2018, 9:56 PM
abdulateef akinola
abdulateef akinola - avatar
2 ответов
+ 2
string = text + str(intVariable) + str(floatVariable)
9th Jan 2018, 9:57 PM
Jeremy
Jeremy - avatar
+ 1
Depending on which answer you want int(), float(), and str() will convert a value of the other two to the corresponding type. i = int("45")+5 #i=50 s = "45"+str(5) #s="455"
9th Jan 2018, 11:16 PM
John Wells
John Wells - avatar