I am new to programming and trying to understand the syntax.
in my example, i would like to have a result of: table = [[1,2,3], [2,4,6], [3,6,9]] but somehow i get and empty list. I am not sure where to fix it.
row = [1, 2, 3]
col = [1, 2, 3]
li = []
table = []
for x in row:
for n in col:
li.append(x*n)
table.append(li)
li.clear()
print(table)

li.clear()?table.append(li[:])- if you clear the same list that you're appending to the table, obviously you'll end up with[]. Append a copy instead[[1,2,3],[1,2,3,2,4,6],[1,2,3,2,4,6,3,6,9]]