Question: I have an interveiw yesterday, when I write python code to achieve some algorithm, I have a question. Some logic can be achieved like this using C:

```
void get_some_num(int a[], int length) {       
   int i;
   for(i = 0; i < length - 1; ++i) {
       if(something) i++; // jump a num in the array
       a[i] = 1;
   }
    return some_num;
 }

```

C language can jump some elements(such as n) when using `i += n` statement in for-loop to iterate an array, but I find it's difficult to achieve by using python's for statement gracefully.

How can I do it?

Answer: 
Python also supports continue to "skip steps" and continue the loop. 

Using it in a for loop:

```
for i in range(0, 10):
    if i == 5:
        continue
    # will never print 5
    print(i)

```

if you are looking to make it skip a few indexes in your iteration, then you can do something like this with a while loop:

```
x = range(0, 10)
i = 0
while i <= len(x):
    if i == 5:
        i += 3
        continue
    print(i)
    i += 1

```

Output:

```
0
1
2
3
4
8
9
10

```
I've never really had much need to skip more than one step, but... You can use a `skip` variable that you decrement every time you skip.

```
skip = 0
for i, item in enumerate(my_list[:-1]):
    if skip:
        skip -= 1
        continue
    if item == my_list[i+1]:
        skip = 1   # or whatever n value you want
        continue
    # Other code

```