diff --git a/illustrations/1_tester/test_unitaire.py b/illustrations/1_tester/test_unitaire.py index 3a0ff33..4cba9b5 100644 --- a/illustrations/1_tester/test_unitaire.py +++ b/illustrations/1_tester/test_unitaire.py @@ -5,11 +5,22 @@ def est_premier(n): >>> est_premier(5) True >>> est_premier(4) - True + False """ - for k in range(n): - if k % n == 0: + for k in range(2, n): + if n % k == 0: return False return True +# Exercice: Soit S un string +# S = mot_1 mot_2 … mot_n +# renvoyez miroir(mot_1) … miroir(mot_n) +def reverse_words(S): + """ + >>> reverse_words("abc def") + cba fed + >>> reverse_words("bonjour bonsoir") + roujnob riosnob + """ + pass