Popsicle problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Popsicle problem

I wrote a script that works for the most part. The final test case, case#5 fails. Here is my script. siblings = int(input()) popsicles = int(input()) if((popsicles / siblings) % 2) == 0: print("give away") else: print("eat them yourself") #end How might I perfect this code to complete the challenge?

7th Apr 2020, 6:48 PM
Jesse Grossbohlin
Jesse Grossbohlin - avatar
3 Answers
+ 2
should be : if popsicles % siblings == 0: may be you didn't understand % well.
7th Apr 2020, 6:54 PM
Bahhaⵣ
Bahhaⵣ - avatar
+ 7
just code, if popsicles % siblings == 0: instead whatever you typed It will be fine then
7th Apr 2020, 6:53 PM
M Tamim
M Tamim - avatar
+ 1
Thank you for your help. I guess I just made it overcomplicated.
7th Apr 2020, 6:56 PM
Jesse Grossbohlin
Jesse Grossbohlin - avatar