say i have a list
[1,2,3,4,5,6,7]
and id like to print, 3,4,5 then 2,3,4,5,6 finally 1,2,3,4,5,6,7
using a for loop, and a slice value within its body is it possible to add to a set slice value?
as this doesn't work i will present it as pseudo code as an example to possibly better illustrate.
inv=[1,2,3,4,5,6,7]
for i in range(0,3,1):
add=(inv[3-1:4+1])
print (add)
The [3-1:4+1] being the pseudo part of the code for now as it doesn't increment on each pass. It only changes the value of the slice the one time.
[1,2,3,4,5,6,7]
and id like to print, 3,4,5 then 2,3,4,5,6 finally 1,2,3,4,5,6,7
using a for loop, and a slice value within its body is it possible to add to a set slice value?
as this doesn't work i will present it as pseudo code as an example to possibly better illustrate.
inv=[1,2,3,4,5,6,7]
for i in range(0,3,1):
add=(inv[3-1:4+1])
print (add)
The [3-1:4+1] being the pseudo part of the code for now as it doesn't increment on each pass. It only changes the value of the slice the one time.