Skip to content

Instantly share code, notes, and snippets.

@binki
Created September 24, 2015 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save binki/47e17004b8e843c4096b to your computer and use it in GitHub Desktop.
Save binki/47e17004b8e843c4096b to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import math
size = int(input('Enter the desired size of your table>'))
justwidth = 1 + int(math.log10(size*size))
for y in range(1, size+1):
print(' '.join([str(x*y).rjust(justwidth) for x in range(1, size + 1)]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment