This commit is contained in:
Samuel Vermeulen 2023-01-03 17:08:10 +01:00
parent e6c3227145
commit 685b914f7d

10
Analyse_de_frequence.py Normal file
View File

@ -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]))