Python String - Number && Number - String Conversion


#1

How To Convert String Into Numbers :- “41” To 41 and Numbers Into String : - 50 To “50” ?


#2

Number To String Conversion:

number = 5
#number is an integer
string = "" + number + ""
#string is now string of the number

#3

And the point of this post is?


#4

I asked how to do this but i didn’t got any reply so i discovered it myself and posted it for others.


#5

better simply cast them. It’s clearer.

number = 5
#number is an integer
string = str(number)
#string is now string of the number

#6

Please do not post code answers for others here at codecombat we want to help coders grow and simply giving then the necessary answers does not help them grow