Run
# Input string with multiple lines x = "Line 1\nLine 2\nLine 3" # Split the string into lines using splitlines() lines = x.splitlines() # Print each line for line in lines: print(line)
Output