i want to execute for_loop like (n→n-1→n-2…)
i wrote the following code but it didn’t work.
n=3
for i in n:1
...
end
Please tell me how to solve it.
i want to execute for_loop like (n→n-1→n-2…)
i wrote the following code but it didn’t work.
n=3
for i in n:1
...
end
Please tell me how to solve it.
for i in n:-1:1
without a step, the default step 1
is used.
As @mauro3 said, change your code like this
n=3
for i in n:-1:1
...
end
thanks!!
it worked well.