Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- #
- # Multiplication table using single for loop in python
- #
- def multiply(table):
- i = 1
- for j in range(0, (table * 10)):
- print '\t',
- print ((j % 10) + 1) * i,
- if ((j + 1) % 10 == 0 and j != 0):
- i += 1
- print
- print
- table = int(raw_input("Enter the size of the table: "))
- multiply(table)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement