Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions multiplication_table.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
from sys import argv # import argment variable

script, rows, columns = argv #define rows and columns for the table and assign them to the argument variable
script, rows, columns = argv # define rows and columns for the table and assign them to the argument variable


def table(rows, columns):
for i in range(1, int(rows) + 1 ): #it's safe to assume that the user would mean 12 rows when they provide 12 as an argument, b'coz 12 will produce 11 rows
for i in range(1, int(rows) + 1 ): # it's safe to assume that the user would mean 12 rows when they provide 12 as an argument, b'coz 12 will produce 11 rows
print ("\t", i,)

print ("\n\n")
print ("\n\n") # add 3 lines

for i in range(1, int(columns) + 1 ):
print (i),
for j in range(1, int(rows) + 1 ):
print ("\t",i*j,)
print ("\n\n")
print ("\n\n") # add 3 lines

table(rows, columns)