0
Python list multiplication
[4,0] * 2 : [4, 0, 4, 0] where as [4, 0] *-2 : 0 Why when a list is multipled by negative numbers gives 0. Can anyone help me to understand this clearly
1 Answer
0
because
[10:5]*-2 == [10:5]-[10:5]-[10:5] == 0
[4,0] * 2 : [4, 0, 4, 0] where as [4, 0] *-2 : 0 Why when a list is multipled by negative numbers gives 0. Can anyone help me to understand this clearly