Mar 04, 2019 · Can someone help me with a way to split string into array? Eg: ["My name is Sona", "I live in ... ','live','in','India']] Thank you in advance. 39968/how-to-split-a-string-to-array-in-python
You will take the text as input by the user using text = input (“Enter the text:”). After that, you will use the split method text.split () for splitting the text strings. Inside the split () method, there are no argument values, therefore, python interpreter will split the strings after each whitespace. Method 2 How to Split a String in Python In Python, you split a string into a list using the split () method. Start with a string that has a delimiter on which you would like to split: