Explain the synbtax to split a string in python?



Explain the synbtax to split a string in python?..

Answer / Prashant Agnihotri

In Python, the 'split()' function is used to split a given string into a list where each word must separate by spaces or delimiter specified. The default delimiter is whitespace. Here's an example: `my_string = 'Hello World'` and `my_list = my_string.split()`, then `my_list ['Hello', 'World']`.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

How to add an index, row or column to a pandas dataframe?

1 Answers  


Tell me what is the difference between xrange and range?

1 Answers  


What is range() in python? Give an example to explain it.

1 Answers  


Write a coding in find a largest among three numbers?

1 Answers  


What is a numpy array?

1 Answers  


How does break, continue and pass work?

1 Answers  


As python is more suitable for the server-side application, it is very important to have threading implemented in your server code. How can you achieve that in python?

1 Answers  


What is with open in python?

1 Answers  


How many modes are there in python?

1 Answers  


Does python have a built in function for string natural sort?

1 Answers  


How can I find methods or attributes of an object in Python?

1 Answers  


What do you understand by the term deep copy?

1 Answers  


Categories