Skip to content
Snippets Groups Projects
Commit 48c8ba90 authored by Dahmane Lynda's avatar Dahmane Lynda
Browse files

somme

parent b438e009
Branches
No related tags found
No related merge requests found
#Dahmane lynda
#TP3
#31/01/2024
def somme(a:int,b:int)->int:
"""renvoie la somme des deux entiers a et b
Précondition :
Exemple(s) :
$$$ somme(4,5)
9
$$$ somme(2,1)
3
"""
if a==0:
res=b
else:
res=somme(a-1,b+1)
return res
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment