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 |
| ||||
Related |
string String Formatting .find() .join() .split() .replace() |
Updated on Mon Sep 21 15:53:25 2020.
If you see any errors or have comments, please let us know.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License