I'm trying to convert a string-like interval (example: '1:10') to a useful integer interval (example: 1:10). The point is that my methods aren't working. I tried to refer to the string interval and it didn't work:
x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
string_interval = '0:4'
x[string_interval]
Desired output:
1, 2, 3, 4, 5
I also tried to convert the string_interval to an integer with int() but it didn't work too.