When you are executing [ * columns] * rows you're basically generating a list of 3 references to the same list.
It is equivalent to the following code:
a = [0, 0, 0] # a =  * columns
result = [a, a, a] # result = [a] * rows
Therefore when you do result, result and result you're actually referencing the same underlying memory as a. Since they all are referencing to the same object, when you do the last three lines:
: 2 + 8 = 10
: 2 + 2 = 4
: 8 + 6 = 14
You're basically modifying the same underlying entity, a (in our case). If you want to allow the result array programmatically, then you'll have to do
result = [ * columns for _ in range(rows)]
Interested in learning Python? Enroll in our Python Course now!