|
本帖最后由 weixiang1120 于 2019-11-17 23:37 编辑
代码1 from pygal_maps_world.maps import COUNTRIES def get_country_code(country_name): for code,name in COUNTRIES.items():
if name==country_name:
return code
else: return None 代码2 from pygal_maps_world.maps import COUNTRIES def get_country_code(country_name): for code,name in COUNTRIES.items(): if name==country_name: return code return None 请问这两个代码有什么不同 有大神可以解释一下不同在哪里吗? |
|