Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

split() list

# Python program to take space
# separated input as a string
# split and store it to a list
# and print the string list
  
# input the list as string
string = input("Enter elements (Space-Separated): ")
  
# split the strings and store it to a list
lst = string.split()  
print('The list is:', lst)   # printing the list
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #list
ADD COMMENT
Topic
Name
5+6 =