string to list : String Cast « String « Python






string to list

 

print str([1, 2]) + "34"                   # Same as "[1, 2]" + "34"
print [1, 2] + list("34")                  # Same as [1, 2] + ["3", "4"]

   
  








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.Convert int: to and from stringConvert int: to and from string