+ 1
Popsacles Aufgabe
Hallo, bin noch neu dabei aber vllt kann mir einer bei folgendem helfen: def pops(siblings,popsicles): siblings=int(input(siblings )) popsicles = int(input(popsicles )) if popsicles % siblings==0: return('give away') else: return('eat them yourself') print(pops(2,5)) Ich bekomme hier neben dem gewĂŒnschten Ergebnis immer zusĂ€tzlich davor eine 25- weiĂ einer warum?
3 Réponses
+ 2
don't complicate your code.
just use 2 inputs, create a variable that stores a result, and use a comparison.
I hope this helps
+ 1
Koljo ,
some issues that should be fixed:
> the call of the function `pops(2,5)` is done with 2 hard coded values. this is not correct. remove them.
> also remove the arguments from the function header
> for output in code coaches, only the required values should be used. so do not use any arguments inside input() functions.
> the values 2 and 5 appear as output, because in your current code these values are given as arguments to the parameters in the function header. the input() functions are using these parameters as a user prompt.
+ 1
Ok thank you really much, i corrected it now and it works fine