No difference between the lists but why different outputs

This is a well-known Python two-dimensional array trap.

7*[1] actually generates a pointer to [1,1,1,1,1,1,1,1], and h is actually made up of five identical pointers, so modifying one value modifies all five at the same time.

A correct way to generate large two-dimensional arrays in Python would look like this

for i in range(0,5):

OK. Thank You, got it!