vis1 = [0 for i in range(10)]
vis2 = [0] * 10
Result of these two lines is
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
When we execute
name = "ram" * 10
then it multiplies "ram" 10 times and returns whole string
ramramramramramramramramramram
So why the same is not happening with [0]*10
it should return 10 lists containing 0 according to similarity, Where i am going wrong ?
and Please explain the 1st line also i.e.
vis1 = [0 for i in range(10)]
Does it return 0 10 times inside the list while running loop or what else