开发者

Quick Python Syntax Error

allData is a hash table. key values are product numbers. the value is a list of tuples. The first value in the tuple is either 0,1,2,3 and the second value of the tuple is a list of errors for that number.

print len(allData[modelNumber][0][1]) #compi开发者_JS百科les fine

File "burninprocessor.py", line 467
   bars = [len(allData[modelNumber][0][1]), len(allData[modelNumber][1][1], len(allData[modelNumber][2][1], len(allData[modelNumber][3][1])]
                                                                                                                                        ^
SyntaxError: invalid syntax


You have no closing parentheses on the second and third term in your 4-tuple. Try (split across lines for readability here but you probably want to keep it on one line in your code):

bars = [len(allData[modelNumber][0][1]), len(allData[modelNumber][1][1]),
        len(allData[modelNumber][2][1]), len(allData[modelNumber][3][1])]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜