0 like 0 dislike
How do you use the split() function in Python?
in Python Coding by Wooden (1.4k points) | 9 views

1 Answer

0 like 0 dislike

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.

str = 'pdf csv json'
print(str.split(" "))

The output:

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


by Wooden (1.4k points)

Related questions

0 like 0 dislike
1 answer
Welcome to MathsGee Skills Question and Answer Bank, a platform, where you can ask study questions and receive answers from other members of the community. Help is always 100% FREE!
MathsGee Q&A is the knowledge-sharing community where millions of students and experts put their heads together to crack their toughest homework questions.

Enter your email address:

Popular Courses

Python For First Timers
Python For Everyone