Oct-30-2018, 07:31 PM
You could use
Another options is to strip the brackets with slicing and then split on the comma.
eval('[1, 2]')
. In some applications that can lead to security flaws, so it gets frowned upon.Another options is to strip the brackets with slicing and then split on the comma.
text[1:-1].split(',')
. That will give you a list of strings, not a list of ints, but you can convert them to ints with a loop of list comprehension.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures