+ 1
Popsicle program
siblings = int(input()) popsicles = int(input()) #your code goes here check = siblings // popsicles if check %2 == 0: print("give away") else: print("eat them yourself") I don't know if its me or if the problem is with sololearn, but i think my code should works find , unfortunately 3 of the cases pass the test but gthe two others ones aint working. Can someone explain me why please? https://www.sololearn.com/coach/3?ref=app
10 Answers
+ 5
Hood💻 🖤 your code is checking whether the division is an even number. Instead, check whether the number of popsicles are evenly divisible amongst the siblings. Hint: if it is evenly divisible, the remainder of the division is zero.
+ 5
Hood💻 🖤 your new attempt is closer. You want to divide popsicles amongst the siblings. Try popsicles % siblings.
+ 4
Brian 😭 it works now perfectly, bruhhh i was torturing my self since yesterday finding a way to resolve this.. i keep my self as far as possible of AI when im coding , i didnt want to use AI to fix it.. thank you for you support man you just gained a new follower.
+ 4
Hood💻 🖤 good work! Keep up the self discipline. There is great benefit from innovating solutions on your own. You'll be better judge of when AI is giving wrong solutions.
Thank you for the follow! 🤗
+ 3
Spam from Andyyyyyy reported.
0
We have no idea what test of what course this code is supposed to solve. Please link to that.
0
Wilbur Jaywright its an exercise in the code coach on sololearn. The first exercise
0
Brian i made it like
if siblings % popsicles
It didnt work too.
0
the problem is asking for the popsicles, if that is even you should distribute them( give them away), and if it's not then you should eat them by yourself.
now what you need is to calculate the input of the popsicles, using the % operator.