title: Python | Make the percentage of a list
body: <p>So I have this code :</p>
  
  <pre><code>from random import *
  from math import *
  n=int(input("n="))
  sommes = [0]*12
  for i in range(1,n+1):
   r=randint(1,6)+randint(1,6)
   if r==1:
    sommes[0] += 1
   if r==2:
    sommes[1] += 1
   if r==3:
    sommes[2] += 1
   if r==4:
    sommes[3] += 1
   if r==5:
    sommes[4] += 1
   if r==6:
    sommes[5] += 1
   if r==7:
    sommes[6] += 1
   if r==8:
    sommes[7] += 1
   if r==9:
    sommes[8] += 1
   if r==10:
    sommes[9] += 1
   if r==11:
    sommes[10] += 1
   if r==12:
    sommes[11] += 1
  print(sommes)
  </code></pre>
  
  <p>And I want to know if I can reduce/optimise that part :</p>
  
  <pre><code>for i in range(1,n+1):
   r=randint(1,6)+randint(1,6)
   if r==1:
    sommes[0] += 1
   if r==2:
    sommes[1] += 1
   if r==3:
    sommes[2] += 1
   if r==4:
    sommes[3] += 1
   if r==5:
    sommes[4] += 1
   if r==6:
    sommes[5] += 1
   if r==7:
    sommes[6] += 1
   if r==8:
    sommes[7] += 1
   if r==9:
    sommes[8] += 1
   if r==10:
    sommes[9] += 1
   if r==11:
    sommes[10] += 1
   if r==12:
    sommes[11] += 1
  </code></pre>
  
  <p>And how can I make sure to give the result as a percentage for each number in the list (1 to 12) like
  that [2, 23, 4, 48, 21] to that [2%, 12%, 4%, 43%, 23%]</p>