【发布时间】:2013-10-13 16:06:25
【问题描述】:
我必须检查完成的井字游戏,并且我必须确保用户输入的每一行都有 3 个符号。我在执行此操作时遇到了问题:
for i in ttt:
if i < len(3):
print("invalid board - too few symbols")
elif i > len(3):
print("invalid board - too many symbols")
else:
continue
ttt 是附加的行。
我在运行它时收到此消息:if i
【问题讨论】:
-
len(i)
标签: if-statement for-loop python-3.x while-loop