How do get summation of return values in different time python
Question: 
    from vaderSentiment.vaderSentiment import sentiment as vaderSentiment
    
    count=0;
    
    f1 = open('testData.txt')#input file 
    
    sentence= f1.readline()
    
    while sentence:
    
        count += 1
    
        print (sentence)
    
        vs =vaderSentiment(sentence)
    
        print ("\t" + str(vs))
    
        sentence=f1.readline()
    
    f1.close
    

This is the code.There input file has many sentences in lines.And result is
like this.

ex: she is good

    
    
    {'pos': 0.592, 'neu': 0.408, 'neg': 0.0, 'compound': 0.4404}
    

she is well

    
    
    {'pos': 0.512, 'neu': 0.488, 'neg': 0.0, 'compound': 0.2732}
    

I want to get whole text file positive ,negative,neutral seprately.That mean
as an example summation of positive counts of sentences.so plz help me .I dont
know what to do


Answer: This is an example, hope it helps

    
    
    from vaderSentiment.vaderSentiment import sentiment as vaderSentiment
    
    testData = ['VADER is smart, handsome, and funny.', 'VADER is smart, handsome, and funny!', 'VADER is very smart, handsome, and funny.', 'VADER is VERY SMART, handsome, and    FUNNY.', 'VADER is VERY SMART, handsome, and FUNNY!!!', 'VADER is VERY SMART, really handsome, and INCREDIBLY FUNNY!!!', 'The book was good.', 'The book was kind of good.',    'The plot was good, but the characters are uncompelling and the dialog is not great.', 'A really bad, horrible book.', "At least it isn't a horrible book.", ':) and :D', '',   'Today sux', 'Today sux!', 'Today SUX!', "Today kinda sux! But I'll get by, lol"]
    
    result = { 'pos':[] , 'neg':[], 'compound':[], 'neu':[] }
    
    for item in testData:
        vs =vaderSentiment(item)
        result['pos'].append(vs['pos'])
        result['neg'].append(vs['neg'])
        result['compound'].append(vs['compound'])
        result['neu'].append(vs['neu'])
    
    print 'sum:'
    for i in result.keys():
        print '\t',i, '=>', sum(result[i])
    

sum: neg => 3.542 neu => 5.59 pos => 6.868 compound => 4.7512

