字典中包含字典的連續調用

dir = {1:'apple',2:'pear',3:'peach',4:{"otherfruits":'banana',"cheapone":'none'}}
print(dir[4]['cheapone'])

none

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章