Python‎ > ‎str‎ > ‎

str.splitlines()


Definition
Return a list of the lines in S, breaking at line boundaries.

Syntax
str.splitlines([keepends]) -> list of strings

Parameters
str=string

Examples
The output is: 
 >>> 
>>> "python".splitlines()
['python']
>>> x="python".splitlines()
>>> x.append["lake"]
>>> y=["Lake"]
>>> x+y
['python', 'Lake']
>>> 

str==str.splitlines()
Equal test on conducted on the string and other str.splitlines.
 >>> x="Python Reserch Centre"
>>> x.splitlines()
['Python Reserch Centre']
>>> type(x.splitlines())
<class 'list'>
>>> y=x.splitlines()
>>> x==y
False
>>> x.splitlines().__eq__(['Python Reserch Centre'])
True
>>> x.splitlines()==(['Python Reserch Centre'])
True
>>> test1=x.splitlines()
>>> test2=['Python Reserch Centre']
>>> test1==test2
True
>>> 


Comments