game-of-life
game-of-life copied to clipboard
Why am i getting a type error?
Im using python 3.6.5 and receiving the following Error.
Traceback (most recent call last):
File "conway.py", line 40, in
Im using python 3.6.5 and receiving the following Error.
Traceback (most recent call last): File "conway.py", line 40, in A = conway(A) File "conway.py", line 16, in conway k[m/2-1 : m/2+2, n/2-1 : n/2+2] = np.array([[1,1,1],[1,0,1],[1,1,1]]) TypeError: slice indices must be integers or None or have an index method
Since slice indices should be integers here, changing '/' to '//' here will fix the issue.
k[m//2-1 : m//2+2, n//2-1 : n//2+2] = np.array([[1,1,1],[1,0,1],[1,1,1]])