white and red sail boat on water during daytime
Photo by Håkon Grimstad on Unsplash

There are a lot of built-in methods that you can use to do a lot of manipulations with strings in Python.

You can convert them into lists, convert them from one case to another, or split them into partitions.

One such method is the opportunity to partition strings.

We have already seen how we can convert a string into a list in Python by using split().

Let’s see it one more time:

0000000000000000

Now we are going to see a method that I recently learned.

Let’s say that we have sentences that we get from a crawler and we want to make sure we do a split based on a keyword:

00000000000000000000


As you can see from the comments, the result from the partition() is a tuple.

The difference between these two is that when we are using split() we get a list as a response.

Yeah, I know it’s not a big deal, but it is still worth having it part of your programming arsenal.


That’s basically it. 

I hope you find this useful.