【发布时间】:2012-05-02 09:14:22
【问题描述】:
这是我的代码:
for i in tuples:
if i[0] == "U_shape":
pieces.append(U_shape(i[1], boardLength, i[2])
if i[0] == "I_shape":
pieces.append(I_shape(i[1], i[2])
if i[0] == "L_shape":
pieces.append(L_shape(i[1], boardLength, i[2])
if i[0] == "T_shape":
pieces.append(T_shape(i[1], boardLength, i[2])
if i[0] == "X_shape":
pieces.append(X_shape(i[1], boardLength, i[2])
这是错误:
if i[0] == "I_shape":
^
SyntaxError: invalid syntax
【问题讨论】:
标签: python syntax if-statement for-loop