EAFP:
try: x = my_dict["key"]except KeyError: # handle missing key
LBYL:
if "key" in my_dict: x = my_dict["key"]else: # handle missing key
欢迎分享,转载请注明来源:内存溢出
EAFP:
try: x = my_dict["key"]except KeyError: # handle missing key
LBYL:
if "key" in my_dict: x = my_dict["key"]else: # handle missing key
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)