Open this example in the interactive library
Source code
print('one\r\ntwo\nthree'.splitlines())Sample output
['one', 'two', 'three']

Handle strings with different newline styles in Python.
Open this example in the interactive library
print('one\r\ntwo\nthree'.splitlines())['one', 'two', 'three']