demo_ref_string_splitlines2.py:
txt = "Thank you for the music\nWelcome to the jungle" x = txt.splitlines(True) print(x)
➜ begtut>python demo_string_splitlines2.py
['Thank you for the music\n', 'Welcome to the jungle']