@anonymous/

ThickSardonicChimpanzee

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from collections import Counter

track_list = ['iphone 6', 'iphone 5', 'moto x2', 'galaxy s6']
tweet_data = ['Eu queria um iphone 6 seriao', 
               'nao gostei do moto x2', 
               'iphone 5 e coisa do passado', 
               'abc123']

tracks = ([track for tweet in tweet_data for track in track_list if track in tweet])

contador = Counter(tracks).most_common()

for palavra, qtd in contador:
    print ("A palavra {0} aparece {1} vez(es)".format(palavra, qtd))