cassolnousmanque Posted March 21, 2021 Share Posted March 21, 2021 (edited) coucou, est ce qu'on peut me confirmer que ce programme affiche 5 et pas 4 ? Le programme suivant affiche 4 : from printer import * def maFonction(nombre): if nombre == 0: return 0 return maFonction(nombre - 2) + 1 print(maFonction(10)) idem pour celui là Le programme suivant affiche 4 : from printer import * def maFonction(nombre): if nombre > 50: return 0 return maFonction(nombre + 10) + 1 print(maFonction(10)) Edited March 21, 2021 by cassolnousmanque Quote Link to comment Share on other sites More sharing options...
Solution sherlock Posted March 21, 2021 Solution Share Posted March 21, 2021 (edited) Hello @cassolnousmanque, c'est exact, les deux programmes vont t'afficher 5 Edited March 21, 2021 by sherlock Quote Link to comment Share on other sites More sharing options...
cassolnousmanque Posted March 21, 2021 Author Share Posted March 21, 2021 il y a 29 minutes, sherlock a dit : Hello @cassolnousmanque, c'est exact, les deux programmes vont t'afficher 5 ok super merci sherlock 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.