Question: Write a function that implements ( works like ) splitlines string method in Python.In the following, an example is given how splitlines Python method works.

Write a function that implements (works like) splitlines string method in Python.In the following, an example is given how splitlines Python method works. It is a string method, thereforeit finds
characters (as delimeter) in the string and splits the string and returns a list of lines.txt = "Thank you for the music
Welcome to the jungle"x = txt.splitlines()print(x)prints,['Thank you for the music', 'Welcome to the jungle']Lets say you have given the name isplitlines to your function. Thentxt = "Thank you for the music
Welcome to the jungle"def isplitlines(x):# Write your code herepass # Delete this line if you copy this to your workfile.print(isplitlines(txt))prints,['Thank you for the music', 'Welcome to the jungle']

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The question is about writing a custom Python function that emulates the builtin splitlines string m... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!