python统计英文词频

poem_EN ='Life can be good,Life can be sad,Life is mostly cheerful,But sometimes sad.'
poem_list = poem_EN.split()
print(poem_list)
p_dict ={}
for item in poem_list:
    if item[-1]in ',.\'"':
        item = item[:-1]
    p_dict[item] = p_dict.get(item,0)+1
    '''    
    if item  not in  p_dict:
        p_dict[item] = 1
    else:
        p_dict[item] +=1
    '''
for ci,value in p_dict.items():
    print(ci,value)