【发布时间】:2017-05-18 15:43:21
【问题描述】:
我正在尝试创建数独,但出现此错误。我认为这是因为range 行;也许我做错了,但range(int(numb/numb+3)) 也不起作用。谢谢您的帮助。
File "D:\Games\Python\sudokuV2Test2.py", line 83, in estDansSousMatrice
for i in range(bl, bl+3):
TypeError: 'float' object cannot be interpreted as an integer"
这是代码:
def estDansSousMatrice(grille,l,c,v):
bc=(c/3)*3
bl=(l/3)*3
for i in range(bl, bl+3):
for j in range(bc,bc+3):
if grille[i][j]==v:
return True
return False
【问题讨论】:
标签: python-3.x