結果 : how to do pattern recognition in python