結果 : pattern matching algorithm in python