Answer the question
In order to leave comments, you need to log in
How to make code easier python?
How to make the code simpler and more readable?
An array can be three dimensional
a =
for x in range(10):
a[0][0] += 1
for i in range(len(a)-1):
for y in range(len(a[i])-1):
if a[i][y] > 1:
a[i][y] = 0
a[i][y+1] += 1
if a[i][len(a[i])-1] > 1:
a[i][len(a[i])-1] = 0
a[i+1][0] += 1
if a[len(a)-1][len(a[len(a)-1])-1] > 1:
a[len(a)-1][len(a[len(a)-1])-1] = 0
print(a)
Answer the question
In order to leave comments, you need to log in
row=a[i]
a[-1]
range(len)
Use enumerate instead or in generalfor v in a
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question