Samuel Vermeulen 5 months ago
parent
commit
685b914f7d
  1. 10
      Analyse_de_frequence.py

10
Analyse_de_frequence.py

@ -0,0 +1,10 @@
nbLignes, nbMots = map(int, input().split(" "))
histogramme = [0] * 101
for loop in range(nbLignes):
mots = input().split(" ")
for idMot in range(nbMots):
longueur = len(mots[idMot])
histogramme[longueur] = histogramme[longueur] + 1
for longueur in range(101):
if histogramme[longueur] > 0:
print("{} : {}".format(longueur, histogramme[longueur]))
Loading…
Cancel
Save