結果 : function to count number of words in python