diff --git a/6/6.5/6.5.3/main.py b/6/6.5/6.5.3/main.py new file mode 100644 index 0000000..b3c9968 --- /dev/null +++ b/6/6.5/6.5.3/main.py @@ -0,0 +1,20 @@ +user_input= input() +lines = user_input.split(',') + +# This line uses a construct called a list comprehension, introduced elsewhere, +# to convert the input string into a two-dimensional list. +# Ex: 1 2, 2 4 is converted to [ [1, 2], [2, 4] ] + +mult_table = [[int(num) for num in line.split()] for line in lines] + +def print_array(array): + result = [] + for row in array: + result = [] + for column in row: + result.append(column) + result.append('|') + result.pop() + print(*result) + +print_array(mult_table)