Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

split word python

# How to spit a word :

text = "Word"
text_list = list(text)
print(text_list)

# Output :
# ["W", "o", "r", "d"]
Comment

split a string into an array of words in python

string = '1-2-3
array_of_words = string.split('-')
print(array_of_words)    # prints ['1', '2', '3']
##################################################
#if you dont pass anything in the split() function,
#the default parameter will be a space
##################################################
string = '1 2 3'
array_of_words = string.split()
print(array_of_words)    # prints ['1', '2', '3']
Comment

PREVIOUS NEXT
Code Example
Python :: .argsort() python 
Python :: unique_together what is used of it in django 
Python :: file.open("file.txt); 
Python :: http server in python 
Python :: moving file in python 
Python :: python xml to csv 
Python :: python add one 
Python :: hashing vs encryption vs encoding 
Python :: solve ax=b python 
Python :: Example of lambda function in python with list 
Python :: kill python process with bash 
Python :: python variables in multiline string 
Python :: last index in python 
Python :: DHT22 raspberry pi zero connector 
Python :: Transform networkx graph to dataframe 
Python :: python lists as dataframe rows 
Python :: writerows to existing csv python 
Python :: extract integer from a string in pandas 
Python :: python list elements 
Python :: python typing effect 
Python :: one line if statement without else 
Python :: connect to spark cluster 
Python :: python for loop get iteration number 
Python :: install python in docker file 
Python :: django collectstatic 
Python :: read json file using python 
Python :: jinja2 template import html with as 
Python :: python is folder or file 
Python :: cassandra python 
Python :: python isinstance list 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =