Convert int: to and from string : String Cast « String « Python






Convert int: to and from string

Convert int: to and from string
 

print int("42"), str(42)         # convert from/to string

print "spam" + str(42)         # force concatenation


           
         
  








Related examples in the same category

1.Convert string: to and from stringConvert string: to and from string
2.Content tests: isalpha, isdigit, etc
3.Strings translate
4.string to list