python - Most efficient way to build single-element list from string with or without spaces? -
one way convert string single-element list in python is: my_string.split(). however, return list multiple elements if string has spaces. what's efficient way create list string may or may not have spaces?
how just
l = [my_string]
Comments
Post a Comment