Skip to content

Instantly share code, notes, and snippets.

@Shaddyjr
Last active June 18, 2019 21:51
Show Gist options
  • Save Shaddyjr/35c4a8830d6be6226603cbdac63cbe7d to your computer and use it in GitHub Desktop.
Save Shaddyjr/35c4a8830d6be6226603cbdac63cbe7d to your computer and use it in GitHub Desktop.
# Quick test for skipping index within loop
nums = [1,2,3,4,5,6,7,8,9,10]
for i in range(len(nums)):
print(i)
num = nums[i]
if(num % 2 == 0):
i += 5
# Doh! prints 0-9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment