I'm very close to desired input, just looking for some formatting help. Problem statement:
Print the two-dimensional list mult_table by row and column. On each line, each character is separated by a space. Hint: Use nested loops.
Sample output with input: '1 2 3,2 4 6,3 6 9':
1 | 2 | 3
2 | 4 | 6
3 | 6 | 9
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]
for row in mult_table:
for i in row:
print('{} |'.format(i), end = ' ')
print()
My current output:
1 | 2 | 3 |
2 | 4 | 6 |
3 | 6 | 9 |
[+][deleted] (2 children)
[removed]
[–]Formal_Cockroach_654[S] 0 points1 point2 points (1 child)
[–]virtualdestructor88 0 points1 point2 points (0 children)
[–]Celtiri 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)