‘splitlines’ method return a list of the lines in the string, breaking at line boundaries.
Signature
splits = str.splitlines()
splitlines_demo_1.py
str = """Hello world
How are you
I am fine, what about you
I am good, thank you...."""
splits = str.splitlines()
for temp_str in splits:
print(temp_str)
Hello world How are you I am fine, what about you I am good, thank you....
No comments:
Post a Comment