Des fichiers textes sont fournis pour vos tests :
Programmer et tester les fonctions :
nombre_caracteres(nom_fichier) qui retourne le nombre de caractères du fichier dont on donne le nom,nombre_mots(nom_fichier) qui retourne le nombre de mots du fichier dont on donne le nom.Attention : Les chiffres comptent comme des caractères de texte et les mots liés par un trait d'union sont comptés comme un seul mot.
# tests
assert nombre_caracteres('stats_fichier1.txt') == 684
assert nombre_caracteres('stats_fichier2.txt') == 1506
assert nombre_caracteres('stats_fichier3.txt') == 2627
assert nombre_caracteres('stats_fichier4.txt') == 1076
assert nombre_mots('stats_fichier1.txt') == 131
assert nombre_mots('stats_fichier2.txt') == 263
assert nombre_mots('stats_fichier3.txt') == 465
assert nombre_mots('stats_fichier4.txt') == 200