結果 : how to put constraints on input in python