Multiplication Table

Python Programming

Python Programming Examples

#!/usr/bin/evn python

print "12's table in Python"

# Declear and assign value in two variables
num = 12
i = 1

# While loop
while (i <= 10):
    # Print integer values
    print "%d x %d = %d" % (num,i,num * i)
    # Increment value
    i += 1
print 'Good bye!'


#***** Output *****
12's table in Python
12 x 1 = 12
12 x 2 = 24
12 x 3 = 36
12 x 4 = 48
12 x 5 = 60
12 x 6 = 72
12 x 7 = 84
12 x 8 = 96
12 x 9 = 108
12 x 10 = 120
Good bye!

Learn more about While loop