[code=python
]jhf=[{菜名:'青椒肉絲',價格:'15元'},{菜名:'宮保雞丁',價格:'10元'}]
print("選單:")
for r in jhf :
print([菜名],'\000',[價格])
[/code]
請問如何輸出菜名和價格!!!
在線等!!!
非常急!!!
uj5u.com熱心網友回復:
r 是一個字典
for r in jhf:
print(r['菜名'],r['價格'])
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/251213.html
