Computer Science, asked by pujayashu123, 1 year ago

The split() function in Python programming language breaks the string on the basis of:

Answers

Answered by sshaardul
0
it can Break on the basis of illegal input or the data type not matching
Answered by Shaizakincsem
0
inputString.splitlines()

Will give you a list with each item, the splitlines() method is designed to split each line into a list element.

import string string.split(inputString, '\n') # --> ['Line 1', 'Line 2', 'Line 3'

Alternatively, if you want each line to include the break sequence (CR,LF,CRLF), use the splitlines method with a True argument:
Similar questions