How do I create a grid in python with different values? -


i'm trying write 4x4 grid in python last 2 rows contain same numbers first 2 rows.

the end result should this:

0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 

the goal make game above grid traversable. i've tried list comprehensions , concatenating 2 lists , it's not producing right answers.

concatenating 2 lists should work. code concatenating 2 lists

l1 = [1, 2, 3, 4] l2 = [5, 6, 7, 8] l3 = [l1 , l2]; l4 = l3+l3 print l4 

should yield [[1, 2, 3, 4], [5, 6, 7, 8], [1, 2, 3, 4], [5, 6, 7, 8]]


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -