Name

.split()

Examples
alphabet = 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z'
for letter in alphabet.split(','):  # Split letters by ','.
    print(letter)  # Print each letter on a separate line.
Description The method split() returns a list of all words in the string using the provided separator. An optional second argument limits the number of splits.
Syntax
str.split(sep)
str.split(sep,num)
Parameters
sepstring to split words by
numnumber of elements to split
Related string
String Formatting
.find()
.join()
.split()
.replace()

Updated on Tue Feb 27 14:07:12 2024.

If you see any errors or have comments, please let us know.