結果 : how to write step function in python