How split line to list in Python

We can split the line to list using split function in Python.

line="This is test"
line.split()

The output be like as follows.

['This', 'is', 'test']

 

Leave a Reply

Your email address will not be published. Required fields are marked *