Skip to content

Instantly share code, notes, and snippets.

@E01T
Created November 6, 2017 10:10
Show Gist options
  • Save E01T/6c3f8f7808812c4c1fad6fa287b15d68 to your computer and use it in GitHub Desktop.
Save E01T/6c3f8f7808812c4c1fad6fa287b15d68 to your computer and use it in GitHub Desktop.
Modulo in Python 3
# Also check math.fmod() and divmod
for i in range(20):
print(i%10)
print('\n')
for index, i in enumerate(range(-20,0)):
print('{:d}%10 {: d}'.format(i, i%10) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment