Comment Comment by the_gigi I often use split().Instead of: s = ['a', 'b', 'c'] I'll type: s = 'a b c'.split() For multiline lists where I want to get rid of leading whitespace I'll add lstrip(): lines = """line 1 line 2 line 3 """.split('\n') lines = [line.lstrip() for line in lines] parent the_gigi 4 years ago
Instead of:
I'll type: For multiline lists where I want to get rid of leading whitespace I'll add lstrip():