元組解包為循環(huán)我無意中發(fā)現(xiàn)了以下代碼:for i,a in enumerate(attributes):
labels.append(Label(root, text = a, justify = LEFT).grid(sticky = W))
e = Entry(root)
e.grid(column=1, row=i)
entries.append(e)
entries[i].insert(INSERT,"text to insert")我不明白“I,a”的意思,在Google上搜索關(guān)于“for”的信息是很痛苦的,當(dāng)我嘗試使用代碼時(shí),我會得到錯誤:ValueError:需要一個以上的值來解壓有誰知道它做了什么,或者與它有什么關(guān)系,我可以在谷歌上了解更多嗎?
元組解包為循環(huán)
繁星點(diǎn)點(diǎn)滴滴
2019-07-17 16:26:19