Python String splitlines() method

The string.splitlines() method in Python splits the specified string and returns a list of the lines in the string, breaking at line boundaries. 

Syntax

Parameter

keepends(optional): This parameter specifies if the line breaks should be included (True), or not (False). The Default value is not (False).

Return

This method returns a list of the lines in the string, breaking at line boundaries. 

Example 1

Output

Example 2

Output

Pin It on Pinterest

Share This