kwark Posted February 19, 2021 Share Posted February 19, 2021 salut a tous ! je rencontre un soucis avec l'informatique comme d'hab quoi c'est pour les calculs récursifs je comprend pas pourquoi ce programme marcherait pas http://www.noelshack.com/2021-07-5-1613732791-semaine-7.png le nombre c'était 5 enfaite c'est quoi str ??? je pensais avoir compris mais non.. Quote Link to comment Share on other sites More sharing options...
kwark Posted February 19, 2021 Author Share Posted February 19, 2021 j'ai regardé la correction mais je comprend pas du touuuut http://www.noelshack.com/2021-07-5-1613733737-semaine-7.png ici normalement on devrait avoir a chaque fois depart qui diminue de 1 ??? enfaite ca donnerai depart = 5 et après return facto(5-1) * 5 pour la suite on devrait avoir depart = 4 ??? mais enfaite ça fait return(4-1) * 4 ??? Quote Link to comment Share on other sites More sharing options...
Ancien du Bureau Solution Sans-Visage Posted February 19, 2021 Ancien du Bureau Solution Share Posted February 19, 2021 Hello ! J'ai pas fait le programme encore donc je peux pas t'aider, juste te répéter le message d'erreur: la variable "suite" à la ligne 7 n'est pas considérée comme un entier... Après pourquoi, franchement je comprends rien cette semaine donc je saurais pas dire désolé :'))) Pour le str par contre, c'est simplement "l'inverse" de int ! Quand tu fais un input, tu obtiens un "string" (je crois qu'on dit une string mais je préfère dire un), il faut l'interpréter comme une suite de caractères, qui peut être "Bonjour" mais aussi "1010". -> Maintenant, si tu fais: x = "1010" x += x Ton x deviendra 10101010 car tu additionnes des suites de caractères -> Par contre si tu fais : x = "1010" y = int(x) y += y Ton y vaudra 2020 -> Et enfin str te permet de reprendre dans l'autre sens: z = str(y) z += z Ici, tu l'auras compris, z vaut 20202020 Est-ce que ça t'aides ? kwark 1 Quote Link to comment Share on other sites More sharing options...
kwark Posted February 19, 2021 Author Share Posted February 19, 2021 @TACKonquis_mon_coeur saluut !! oui c'était très bien expliqué merciiii j'ai compris le problème grâce à toi merciii Quote Link to comment Share on other sites More sharing options...
Ancien du Bureau Sans-Visage Posted February 19, 2021 Ancien du Bureau Share Posted February 19, 2021 il y a 8 minutes, PassOuPACES a dit : @TACKonquis_mon_coeur saluut !! oui c'était très bien expliqué merciiii j'ai compris le problème grâce à toi merciii Ooooh t'as réussi à faire marcher ton programme ?? Quote Link to comment Share on other sites More sharing options...
kwark Posted February 19, 2021 Author Share Posted February 19, 2021 à l’instant, TACKonquis_mon_coeur a dit : Ooooh t'as réussi à faire marcher ton programme ?? je l'ai un peu modifié avec ton aide et ça a marché Quote Link to comment Share on other sites More sharing options...
Ancien du Bureau Sans-Visage Posted February 19, 2021 Ancien du Bureau Share Posted February 19, 2021 il y a 27 minutes, PassOuPACES a dit : je l'ai un peu modifié avec ton aide et ça a marché Oh bah super alors !! Quote Link to comment Share on other sites More sharing options...
kwark Posted February 19, 2021 Author Share Posted February 19, 2021 il y a 1 minute, TACKonquis_mon_coeur a dit : Oh bah super alors !! d'ailleurs je te vois souvent aider les gens t'es super sympa !!! Quote Link to comment Share on other sites More sharing options...
Ancien du Bureau Sans-Visage Posted February 19, 2021 Ancien du Bureau Share Posted February 19, 2021 il y a 30 minutes, PassOuPACES a dit : d'ailleurs je te vois souvent aider les gens t'es super sympa !!! Ahaha ça me fait plaisir merci 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.