python應(yīng)用操作——?字典轉(zhuǎn)元組(列表list) dict -> tuple
1.將鍵key轉(zhuǎn)成元組
name_dict = {'name_1':'Zarten_1', 'name_2' : 'Zarten_2'}name_tuple = tuple(name_dict) #列表-list即可print(type(name_tuple), name_tuple)
2.將值value轉(zhuǎn)成元組
name_dict = {'name_1':'Zarten_1', 'name_2' : 'Zarten_2'}name_tuple = tuple(name_dict.values())print(type(name_tuple), name_tuple)
繼續(xù)查找其他問(wèn)題的答案?
- 開(kāi)始學(xué)習(xí)
海報(bào)設(shè)計(jì)精品錄播課程2121次觀(guān)看
開(kāi)始學(xué)習(xí)字體設(shè)計(jì)精品錄播課程2121次觀(guān)看
開(kāi)始學(xué)習(xí)室內(nèi)設(shè)計(jì)精品錄播課程2121次觀(guān)看
開(kāi)始學(xué)習(xí)影視動(dòng)畫(huà)精品錄播課程2121次觀(guān)看
開(kāi)始學(xué)習(xí)UI設(shè)計(jì)精品錄播課程2121次觀(guān)看
開(kāi)始學(xué)習(xí)
點(diǎn)擊加載更多評(píng)論>>