diff --git a/Tp3/tracing_recurcing.py b/Tp3/tracing_recurcing.py new file mode 100644 index 0000000000000000000000000000000000000000..d08370815411587fd6b67d457b7400457222f627 --- /dev/null +++ b/Tp3/tracing_recurcing.py @@ -0,0 +1,19 @@ +#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