cours: exercice 1

master
Raito Bezarius 5 years ago
parent c8fafe2ce3
commit 57b40c4683

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

Loading…
Cancel
Save