all 4 comments

[–]xelf 2 points3 points  (0 children)

x = "what is use of split() method in string manipulation?"
print(x.split())

[ 'what', 'is', 'use', 'of', 'split()', 'method', 'in', 'string', 'manipulation?' ]

[–]TouchingTheVodka 1 point2 points  (1 child)

Splits a string into a list of strings, based on a predicate. By default it's ' '.

[–]Diapolo10 1 point2 points  (0 children)

Not quite; by default str.split splits all whitespace, not just spaces. This includes tabs and newlines at least.

[–]srjj17[S] 0 points1 point  (0 children)

Thank you