結果 : how to prevent keyerror in python