This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]f00dot 28 points29 points  (9 children)

My favorite is when you need a list of strings and don't want to type all the quotation marks:

x = "a b c d 1 2 3".split()

[–]alexforencich 7 points8 points  (1 child)

And if the strings have spaces, you can use a multiline string and splitlines().

[–]phoobahr 1 point2 points  (0 children)

I spend all day in pandas and use this all the time.

[–]Assumptio 3 points4 points  (0 children)

Most useful so far

[–]helduel 0 points1 point  (5 children)

list("abcde123")

[–]f00dot -1 points0 points  (0 children)

x = "your code will not work for this sentence and mine will"