#here’s my list:
a_list = [1, ‘a’, False, 3.14, None, 4<=5, [35, ‘omg list of list’,‘True’, False]]
I wanted to print: a, False, 3.14, None, True, True, False
so I entered the code as:
print(a_list[2:7[2:]])
#here’s my list:
a_list = [1, ‘a’, False, 3.14, None, 4<=5, [35, ‘omg list of list’,‘True’, False]]
print(a_list[2:7[2:]])
You cannot combine indexing in python like this, to get what you want you have to treat the inner array part separately, check the code below,
print(a_list[1:6] + a_list[6][2:])
Hope it helps,