what will be the value of ls?
ls=[]
ls+="python"
答案是['p','y','t','h','o','n']
怎么就散黃了呢?
uj5u.com熱心網友回復:
ls += "python" 這個操作相當于強制把 "python" 進行了list(),然后進行串列合并,你可以試一下 list("python") 就等于 ['p', 'y', 't', 'h', 'o', 'n']轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/80748.html
上一篇:iter是過濾器嗎?
