4. digit_sum / 4. somme_chiffre


#1

Hello, i have some pb with the french version of this page

en : https://www.codecademy.com/courses/python-intermediate-en-rCQKw/0/4?curriculum_id=4f89dab3d788890003000096#

fr: https://www.codecademy.com/fr/courses/python-intermediate-fr-FR-py0yl/0/4?curriculum_id=5370f030fed2a866a2000001#

On the en site i wrote :

def digit_sum(n):
total = 0
while n >= 1:
total += n%10
n = n//10
return total

All's right !

On the french version i wrote :

def somme_chiffre(n):
total = 0
while n >= 1:
total += n%10
n = n//10
return total

and it give me an error :

Oups, merci de réessayer. Votre fonction a échoué sur 434 comme entrée car votre fonction indique "'int' object is not callable" error.

Any way to correct this ?


#2

You got a working solution, very good :slight_smile:

The validation of the french one is bugged. Put this:

def somme_chiffre(n):
     return somme_chiffre

as code to get a pass, it fools the exercise validation


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.