Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
arr = [1,2,3,4,5,6,7,8,9,10]
for i in range(len(arr)):
if i in range(1,5): continue
print(i)
So python or pluses? Those tags are weird.
On the plus side, make a for loop and increment the counter when you need to.
In python - probably it is also possible, in extreme cases - while i < len (array)
Walkthrough with step 2
for i in range(0, 10, 2):
print i
for i in range(0, len(array), 6):
If you know where to "jump" after the first step before entering the loop, then you can do this:
for i in [0] + [j for j in range(6, len(array))]:
print(array[i])
It can be simpler by making the first iteration a direct call (if a function) and starting from the 6th.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question