# the example_1 aim to tell how to use dctionary,and how to access list or dictionary infos={"first_name":"jack","last_name":"mole","age":20,"city":"lendon"} for info in infos: print(st…
avilable_foods=["soup","beaf","noddle","pepper"] request_foods=["soup","rice","beaf","suggar"] for request_food in request_foods: if request_food in avilable_foods: print(&quo…
此程序的目的在于,正确而简单的访问字典的键与值 favorite_languages={ 'jen':['python','c'], 'sarah':['c'], 'edward':['ruby','go'], 'phil':['python','java'], } #古老的方法访问字典中键与值 for element in favorite_languages: print(element +"'s favorite languages are:") print("\t&q…
favorite_language ={ "jen":"python", "sarah":"c", "edward":"ruby", "phil":"python", } for name in sorted(favorite_language.keys()):# sort by zimushunxu print(name.title()+&quo…