Advertisement
sebbu

exo inception

Jan 20th, 2019
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def function()
  2.     n=int(input(""))
  3.     a=int(input(""))
  4.     b=int(input(""))
  5.     liste = []
  6.     comptage = []
  7.  
  8.     for k in range(n):
  9.         valeur = int(input(""))
  10.         liste.append(valeur)
  11.  
  12.     for p in range(b-a+1):
  13.         comptage.append(0)
  14.     #comptage = [0] * range(b-a+1)
  15.     #comptage = [0 for i in range(b-a+1)]
  16.  
  17.     for i in range(len(liste)):
  18.         comptage[liste[i]-a] += 1
  19.  
  20.     for j in range(a,b+1):
  21.         print("nombre de", j, " : ", comptage[j-a])
  22.     #for j in range(b-a+1)
  23.     #   print("nombre de", j+a, " : ", comptage[j])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement