I'm writing a python program that takes user input from the command line. The user is told to enter in values in a list format, i.e. the user might enter [1, 2], [2, 7], [4, 3]
, etc.
I'm splitting this input string at ", "
so that my program has access to a list such as:
['[1, 2]', '[2, 7]', '[4, 3]']
Is there any way to convert each of these "string lists" into actual lists? I don't want to have to split these strings and remove the brackets, extract the values, and create a new list manually.
Thanks!