結果 : how to avoid if statements in python