Answers for "split pythong"

26

split string in python

def split(word): 
    return [char for char in word]  
      
# Driver code 
word = 'geeks'
print(split(word)) 

#Output ['g', 'e', 'e', 'k', 's']
Posted by: Guest on December-07-2019
12

python split

>>> '1,2,3'.split(',')
['1', '2', '3']
>>> '1,2,3'.split(',', maxsplit=1)
['1', '2,3']
>>> '1,2,,3,'.split(',')
['1', '2', '', '3', '']
Posted by: Guest on November-18-2020
0

python split

text = 'geeks for geeks'
  
# Splits at space
print(text.split())
Posted by: Guest on October-26-2021

Python Answers by Framework

Browse Popular Code Answers by Language