Categories

Dec 14, 2019 in Python

Q: How Do You Use The Split() Function In Python?

1 Answer

Dec 14, 2019
Python’s split() function works on strings to cut a large piece into smaller chunks, or sub-strings. We can specify a separator to start splitting, or it uses the space as one by default.

#Example

str = 'pdf csv json'

print(str.split(" "))

print(str.split())

The output:

['pdf', 'csv', 'json']

['pdf', 'csv', 'json']
Click here to read more about Python
Click here to read more about Insurance

Related questions

Madanswer
Aug 30 in Python
Dec 14, 2019 in Python
Dec 22, 2019 in Python
...