本文共 378 字,大约阅读时间需要 1 分钟。
# created by swy"""solutions to beginning python"""fridge = { "Milk": "Thise milk", "Cheese": "Emmentaler", "Butter": "Unsalted butter"}food_sought = "Butter"for foodKey in fridge: print("\nlooking at : %s", foodKey) if foodKey == food_sought: print("key: %s \tValue: %s" % (foodKey, fridge[food_sought])) breakelse: print("it was not there")
转载地址:http://nhwai.baihongyu.com/