You have a box of popsicles and you want to give them all away to a group of brothers and sisters. If you have enough left in th | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

You have a box of popsicles and you want to give them all away to a group of brothers and sisters. If you have enough left in th

siblings = int(input()) popsicles = int(input()) if siblings % popsicles == 0: print("give away") elif siblings % popsicles != 0: print("eat them yourself") elif siblings < popsicles : print("give away") What's wrong with my code ?

4th Nov 2021, 7:59 PM
siviwe sam-sam
5 Answers
0
Welcome 😃
5th Nov 2021, 5:10 AM
Adi Nath Bhawani
Adi Nath Bhawani - avatar
+ 3
Interchange position of popsicles and siblings. Check and reply. And please send the whole question. Then it will be more clear
4th Nov 2021, 8:06 PM
Adi Nath Bhawani
Adi Nath Bhawani - avatar
+ 3
this is the complete task decription: You have a box of popsicles and you want to give them all away to a group of brothers and sisters. If you have enough left in the box to give them each an even amount you should go for it! If not, they will fight over them, and you should eat them yourself later. Task Given the number of siblings that you are giving popsicles to, determine if you can give them each an even amount or if you shouldn't mention the popsicles at all. Input Format Two integer values, the first one represents the number of siblings, and the second one represents the number of popsicles that you have left in the box. Output Format A string that says 'give away' if you are giving them away, or 'eat them yourself' if you will be eating them yourself. Sample Input 3 9 Sample Output give away
4th Nov 2021, 8:08 PM
Lothar
Lothar - avatar
+ 2
It worked thanks 😊
4th Nov 2021, 9:55 PM
siviwe sam-sam
+ 1
If popsicles%siblings==0 Then print give away Else Print eat them yourself this will work you had interchanged the place of popsicles and siblings.
4th Nov 2021, 8:11 PM
Adi Nath Bhawani
Adi Nath Bhawani - avatar