for?word?in?ls:?#叠代列表ls
d[word]?=?d.get(word,?0)?+?1?#將叠代出來的每壹個元素作為鍵,該鍵的個數作為值添加到字典,
for?k?in?d:#叠代字典
print("{}:{}".format(k,?d[k]))#格式化打印鍵值