Split the string using the separator 1

Split the string using the separator

# Split the string using the separator

text= "Orange,Apple,Grapes,WaterMelon,Kiwi"
print(text.split(','))

Here is what the above code is Doing:
1. We have a string variable called text.
2. We are using the split() method to split the string using the separator ‘,’.
3. The split() method returns a list of strings.
4. We are printing the list.

Similar Posts