3六、如何實現[‘1’,’2’,’3’]變成[1,2,3] ?

a=['1','2','3']
b=[int(i) for i in a]
print(b)

輸出爲:[1, 2, 3]spa

相關文章
相關標籤/搜索