Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
を発生させたキーを取得する方法はありKeyErrorますか?
KeyError
または一般的に、どこでプロパティを見つけることができますExceptionか?
Exception
脚本:
d = dict(a=1) try: d['b'] except KeyError as e: print e
出力:
'b'