Am working on multiplication program but i'm having trouble with it.
Here's my program:
def multiplication_table(n):
row = 1
col = 1
while row <= n:
while col <= n:
print 'row', ' * ', col, ' = ', row * col
col = col +1
row = row + 1
multiplication_table(2)
The output should look like this:
#1 * 1 = 1
#1 * 2 = 2
#2 * 1 = 2
#2 * 2 = 4
In my head the program logic makes sense but i don't get an output which suggests its broken loop of some sort but i'm so burnt out right now i can't seem to figure it out.
Any help is appreciated! thanks.

New Topic/Question
Reply



MultiQuote




|