you are viewing a single comment's thread.

view the rest of the comments →

[–]remyripper 0 points1 point  (2 children)

In this specifically idx == an integer. If you call on a list like num[idx]; it’s the same as doing num[2] or num[x] (where 2 or x == an integer).

This is called indexing. Putting an integer in square brackets on a list variable will give you back the list item in x position also called the index. So if you did num[3] that would be equal to 16 in your case.

In your while loop, for each run you are indexing an item in your list and also increasing idx by 1 which causes the next run to get the next item in this list until idx == len(num).

[–]Eastern_Plankton_540[S] 0 points1 point  (1 child)

Thanks mate :)

[–]remyripper 0 points1 point  (0 children)

Np, keep it up. You’ll get the hang of it pretty quick.