Run
x = "apple\nbanana\ncherry" lines = x.splitlines() print(lines)
Output