1234567 |
- items_price = {"apple":30, "banana":20, "cherry":15, "date":10}
- items_price["banana"] = 25
- del items_price["cherry"]
- items_price["elderberry"] = 40
- print("apple的价格为:", items_price["apple"])
- for item, price in items_price.items():
- print(f"{item}:{price}")
|