browncrown

[Project] Multiplication Table

Oct 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. #https://www.reddit.com/r/beginnerprojects/comments/2agwnq/project_multiplication_table/
  2.  
  3. length = int(input('How big do you want the multiplication table be?\n'))
  4. for f in range(0,(length+1)):
  5.     if f == 0:
  6.         print('x'.rjust(3), end = '  |')
  7.     elif f != (length) and f != 0:
  8.         print(str(f).rjust(3), end = '   ')
  9.     else:
  10.         print(str(f).rjust(3))
  11. print('-' *length * 7)
  12. for i in range(1,(length+1)):
  13.     print(str(i).rjust(3), end = '  |')
  14.     for m in range(1,(length+1)):
  15.         print(str(i*m).rjust(3), end = '   ')
  16.     print('')
Add Comment
Please, Sign In to add comment