結果 : algorithm for if statement in python