+ 3
Popsicles
Sorry, but my code not correct? siblings = int(input()) popsicles = int(input()) if siblings + popsicles <= 7: print('eat them yourself') else: print('give away')
2 Réponses
+ 7
Read again the problem. What you're doing is adding siblings and popsicle which has no reason to do so.
The problem needs to determine if there are extra candies, if there are extra candies, eat the candies so your siblings won't fight, otherwise give it.
- - - - - - - - - - - - - -
Hint:
--> You can use modulus(%) operator to know if there are extra candies
For example:
I have 20 candies and 2 siblings
>> 20 % 2 == 0
# Since the answer or remainder is 0, there is no extra candy and I can give the candies.
If you have more questions, feel free to ask. Thanks!
+ 2
Thank you!