Answers for "convert list of string to list of object python"

44

convert string to list python

# To split the string at every character use the list() function
word = 'abc'
L = list(word)
L
# Output:
# ['a', 'b', 'c']

# To split the string at a specific character use the split() function
word = 'a,b,c'
L = word.split(',')
L
# Output:
# ['a', 'b', 'c']
Posted by: Guest on February-18-2020
0

how to change the type of a values in list from str to object python

>>> list_a = ['20.3', '35', '10', '6.74', '323']
>>> list_a = map(float, list_a)
>>> list_a[0]*2
40.6
Posted by: Guest on July-20-2020

Code answers related to "convert list of string to list of object python"

Python Answers by Framework

Browse Popular Code Answers by Language