+ 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

30th Apr 2024, 1:54 AM
Hoodâ™ ïžđŸ‘šđŸżâ€đŸ’»
Hoodâ™ ïžđŸ‘šđŸżâ€đŸ’» - avatar
9 Respostas
+ 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.
30th Apr 2024, 2:48 AM
Brian
Brian - avatar
+ 5
HoodđŸ’» đŸ–€ your new attempt is closer. You want to divide popsicles amongst the siblings. Try popsicles % siblings.
30th Apr 2024, 3:26 AM
Brian
Brian - avatar
+ 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.
30th Apr 2024, 3:34 AM
Hoodâ™ ïžđŸ‘šđŸżâ€đŸ’»
Hoodâ™ ïžđŸ‘šđŸżâ€đŸ’» - avatar
+ 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! đŸ€—
30th Apr 2024, 5:20 AM
Brian
Brian - avatar
+ 3
Spam from Andyyyyyy reported.
30th Apr 2024, 12:36 PM
Brian
Brian - avatar
0
We have no idea what test of what course this code is supposed to solve. Please link to that.
30th Apr 2024, 2:36 AM
Wilbur Jaywright
Wilbur Jaywright - avatar
0
Wilbur Jaywright its an exercise in the code coach on sololearn. The first exercise
30th Apr 2024, 2:39 AM
Hoodâ™ ïžđŸ‘šđŸżâ€đŸ’»
Hoodâ™ ïžđŸ‘šđŸżâ€đŸ’» - avatar
0
Brian i made it like if siblings % popsicles It didnt work too.
30th Apr 2024, 2:54 AM
Hoodâ™ ïžđŸ‘šđŸżâ€đŸ’»
Hoodâ™ ïžđŸ‘šđŸżâ€đŸ’» - avatar
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.
30th Apr 2024, 5:58 AM
Naveed
Naveed - avatar