Is it possible in Python to convert a raw string divided by commas, e.g.
tt0099700,tt0096061,tt0118688,tt0120784
into a Python array/list?
Such string is in loop as a variable row[i]
.
Thanks for any help.
Is it possible in Python to convert a raw string divided by commas, e.g.
tt0099700,tt0096061,tt0118688,tt0120784
into a Python array/list?
Such string is in loop as a variable row[i]
.
Thanks for any help.
Try:
input_list = 'tt0099700,tt0096061,tt0118688,tt0120784'
new_list = input_list.split(',')
Output of new_list
:
['tt0099700', 'tt0096061', 'tt0118688', 'tt0120784']