Locating max value in a list
Question: I'm very new to Python programming and I've been tasked by an online friend to
write code to solve the following problem:

'imagine a board game and you have to roll 2 dices.Write a program to roll the
dices 100 times and find out which value (of both dices) appears most'

My attempt below kind of works in the sense that I'm able to ascertain the max
frequency of two dice faces added together but not the actual dice
thrown.(e.g. the total '9' was the most frequently thrown).

I'm sure there are plenty of ways of accomplishing the above so do excuse my
very first attempt at coding!

    
    
    import random
    results = []
    
    freq_2 = 0
    freq_3 = 0
    freq_4 = 0
    freq_5 = 0
    freq_6 = 0
    freq_7 = 0
    freq_8 = 0
    freq_9 = 0
    freq_10 = 0
    freq_11 = 0
    freq_12 = 0
    
    for i in range(100):
        face1 = random.randrange(1,7)
        face2 = random.randrange(1,7)
        value = face1 + face2
        if value == 2:
            freq_2 += 1
        if value == 3:
            freq_3 += 1
        if value == 4:
            freq_4 += 1
        if value == 5:
            freq_5 += 1
        if value == 6:
            freq_6 += 1
        if value == 7:
            freq_7 += 1
        if value == 8:
            freq_8 += 1
        if value == 9:
            freq_9 += 1
        if value == 10:
            freq_10 += 1
        if value == 11:
            freq_11 += 1
        if value == 12:
            freq_12 += 1
    
    results.append(freq_2)
    results.append(freq_3)
    results.append(freq_4)
    results.append(freq_5)
    results.append(freq_6)
    results.append(freq_7)
    results.append(freq_8)
    results.append(freq_9)
    results.append(freq_10)
    results.append(freq_11)
    results.append(freq_12)
    
    print max(results)
    print freq_2, freq_3, freq_4, freq_5, freq_6, freq_7, freq_8, freq_9,        freq_10, freq_11, freq_12
    


Answer: [`collections`](https://docs.python.org/2/library/collections.html#collections.Counter)
provides `Counter` which makes this task easy:

    
    
    from random import choice
    from collections import Counter
    
    dice = range(1,7)
    freq = Counter([choice(dice) + choice(dice) for i in range(100)])
    
    print freq
    print freq.most_common(1)
    

