Advertisement
SirChimi

MultiplicationTable_v2.py

Aug 17th, 2014
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. mx = raw_input("Enter a max value: ") #prompt for max for x and y
  2. xy = range(1,int(mx) + 1) #make list 1 - max
  3.  
  4. max_len = len(str(xy[-1])) + 2
  5. for x in xy: #iterate 1-max * 1-max
  6.     for y in xy:
  7.         print str(x * y) + " " * (max_len - len(str(x * y))) ,
  8.     print
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement