Write a program to split a string into a list where each line is a list item


Topic: Write a program to split a string into a list where each line is a list item

Solution

txt = "Thank you for the music\nWelcome to the jungle"
x = txt.splitlines()
print(x)



List all Python Programs