Advertisement
Guest User

alice

a guest
Dec 9th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. s = ' aa, df, fv, aa'
  2. l = list(s.split(','))
  3. print (l)
  4. words_dict = dict()
  5. for word in l:
  6. if word in words_dict:
  7. words_dict[word] = words_dict[word] + 1
  8. else:
  9. words_dict[word] = 1
  10.  
  11.  
  12. print(words_dict)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement