Would appreciate some help, how do you slice a python list like example below:
a = [1,2,3,4,5,6,7,8]
I want the slice in a loop so output would be:
8,7,6,5,4,3,2,1
8,7,6,5,4,3,2
8,7,6,5,4,3
8,7,6,5,4
8,7,6,5
8,7,6
8,7
8
should be in function like :
for i in range(len(a)):
print(a["slice here"])
i've tried [-1::-1-i] not sure anymore? thought this would be straightforward ?