Advertisement
marquessbr

multiplication table

Mar 8th, 2012
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. def print_multiplication_table(n):
  2.     n1 = 1
  3.     while n1 < n + 1:
  4.         counter = 1
  5.         while (counter < n + 1):
  6.             n2 = 1
  7.             i = 1
  8.             while i == n2:
  9.                 m = n1 * counter
  10.                 s = '#' + str(n1) + ' * ' + str(counter) + ' = ' + str(m)
  11.                 print s
  12.                 n2 = n2 + 1
  13.             counter = counter + 1
  14.         n1 = n1 + 1
  15.     return
  16.  
  17. print_multiplication_table(3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement