HELP! I can’t seem to understand how to do this- I’m using Python! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

HELP! I can’t seem to understand how to do this- I’m using Python!

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 Thanks for your help in advance!

22nd Mar 2020, 12:07 PM
Rumaanah G
Rumaanah G - avatar
3 Answers
+ 2
Rumaanah G Show us the code so that we may point out mistakes. • Take an input in integer/whole number, about how many siblings he has. • Then take an input in integer about how many popsicles he has. • If he can easily divide those popsicles among his siblings, then print "give away". Suppose there are 9 popsicles and 3 siblings, you can easily divide them. • Otherwise, if u can't divide them, print "eat them yourself".
22nd Mar 2020, 12:17 PM
maf
maf - avatar
+ 2
It seems you have just started with Python. These tasks are meant for you to figure out, since it's a practical application of what you learned. Consequently, first you must have learned. I would recommend to concentrate on learning and practicing Python first, until you feel somewhat confident. Start with follow-up measures like challenges or code coach after that.
22nd Mar 2020, 12:21 PM
HonFu
HonFu - avatar
0
I just want to see what an ideal answer would look like as that’s what im struggling with
24th Mar 2020, 8:13 AM
Rumaanah G
Rumaanah G - avatar