Answers for "convert to list"

5

python string to array

>>> text = 'a b c'
>>> text = text.split(' ')
>>> text
[ 'a', 'b', 'c' ]
Posted by: Guest on May-10-2020
7

how to convert a set to a list in python

my_set = set([1,2,3,4])
my_list = list(my_set)
print my_list
>> [1, 2, 3, 4]
Posted by: Guest on May-19-2020
0

python3 create list from string

input = ['word1, 23, 12','word2, 10, 19','word3, 11, 15']
output = []
for item in input:
    items = item.split(',')
    output.append([items[0], int(items[1]), int(items[2])])
Posted by: Guest on September-16-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language