I am trying to print by breaking a line based on character \n (new line). Below is the example:
line = "This is list\n 1.Cars\n2.Books\n3.Bikes"
I want to print the output as below:
This is list:
1.Cars
2.Books
3.Bikes
I used code as below:
line1 = line.split()
for x in line1:
print(x)
But its printing each word in different line. How to split the string based on only "\n"
Regards, Arun Varma