Skip to content

Instantly share code, notes, and snippets.

@cdchris12
Created April 5, 2020 03:37
Show Gist options
  • Save cdchris12/78569e07da04c271e2979a2ddd9274cf to your computer and use it in GitHub Desktop.
Save cdchris12/78569e07da04c271e2979a2ddd9274cf to your computer and use it in GitHub Desktop.
table = (1,2,3,4,5,6,7,8,9,10)
user_input = 1
while 0 < user_input < 11:
user_input = int(input('Enter a number between 1 and 10: '))
if not 0 < user_input < 11:
# Number out of bounds, exit
exit(1)
# End if
print("Multiplication table for: %s" % user_input)
for item in table:
print("%d * %d = %d".rjust(10) % (item, user_input, item * user_input) )
# End for
# End while
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment