Advertisement
Guest User

Untitled

a guest
Feb 18th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. from collections import Counter
  2. dic={'phone get crasted': 0,'good performance':1,'good camera': 1,'cheap in price':1,'battery drains fast':0}
  3. pos=0
  4. neg=0
  5. for i in dic:
  6.     if dic[i]==0:
  7.         neg=neg+1
  8.     else:
  9.         pos=pos+1
  10. pos=pos/5
  11. neg=neg/5
  12. #print(pos,' ',neg)
  13. for k,v in dic.items():
  14.     print(Counter(k.lower().split()))
  15.    
  16.    # for j in k:
  17.         #print(j)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement