Quelques fonctions.
This commit is contained in:
commit
38a8702013
|
@ -0,0 +1,11 @@
|
|||
def is_even(n):
|
||||
return n % 2 == 0
|
||||
|
||||
def is_odd(n):
|
||||
return not is_even(n)
|
||||
|
||||
for i in range(10):
|
||||
if is_even(i):
|
||||
print(f"{i} est pair")
|
||||
if is_odd(i):
|
||||
print(f"{i} est impair")
|
Loading…
Reference in New Issue