+ 2

Please answer this one by python I tried but I am'not able to answer this

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

18th Aug 2020, 5:27 AM
Bhuvan Blaster
Bhuvan Blaster - avatar
28 Answers
+ 6
Can you share your code?
18th Aug 2020, 5:28 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 6
Really? I don't see a single if/else statement. Sorry mate, you have to try harder.
18th Aug 2020, 5:38 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 5
Your code?
18th Aug 2020, 5:55 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 5
That is not how if/else statements work. Please check this link: https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2277/
18th Aug 2020, 5:58 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 5
siblings = int(input()) popsicles = int(input()) popsicles_left=popsicles-siblings if popsicles_left%siblings==0: print("give away") else: print("eat them yourself") #here it is brother
18th Aug 2020, 9:33 AM
AB💞
AB💞 - avatar
+ 3
Just share your code, I need to make sure that you actually tried your best.
18th Aug 2020, 5:36 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 2
if siblings = 10, popsicles = 20 print (" give away ") elif print ("eat them yourself ") #your code goes here siblings = 3 popsicles = 9 print ("eat them yorself")
18th Aug 2020, 5:57 AM
Bhuvan Blaster
Bhuvan Blaster - avatar
+ 2
Nayanmoni Khatoniar be respectful to other users and use appropriate words.
19th Aug 2020, 3:00 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 2
oluwasanmi jesunifemi I was talking to Nayanmoni because he's the one who said it.
19th Aug 2020, 3:02 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 1
I don't no the proper way to do this
18th Aug 2020, 5:30 AM
Bhuvan Blaster
Bhuvan Blaster - avatar
+ 1
siblings = 10 popsicles = 20 print (" give away ") #your code goes here siblings = 3 popsicles = 9 print ("eat them yorself")
18th Aug 2020, 5:36 AM
Bhuvan Blaster
Bhuvan Blaster - avatar
+ 1
This is my code correct it if it has too mistakes
18th Aug 2020, 5:36 AM
Bhuvan Blaster
Bhuvan Blaster - avatar
+ 1
I have send my code
18th Aug 2020, 5:37 AM
Bhuvan Blaster
Bhuvan Blaster - avatar
+ 1
Ok
18th Aug 2020, 5:38 AM
Bhuvan Blaster
Bhuvan Blaster - avatar
+ 1
Thanks for your advise
18th Aug 2020, 5:39 AM
Bhuvan Blaster
Bhuvan Blaster - avatar
+ 1
If I use if and else statement then it's coming syntax error
18th Aug 2020, 5:52 AM
Bhuvan Blaster
Bhuvan Blaster - avatar
+ 1
Your code?
19th Aug 2020, 12:03 AM
oluwasanmi jesunifemi
+ 1
Alright then thanks
19th Aug 2020, 3:03 AM
oluwasanmi jesunifemi
+ 1
sukka Bhuvan please try out the logic if popsicle%sibling==0: print(give away) else: print (eat them yourself)
19th Aug 2020, 2:20 PM
Purbayan Saha
Purbayan Saha - avatar
+ 1
siblings = int(input()) popsicles = int(input()) if (popsicles % siblings == 0): print("give away") else: print("eat them yourself") This should work....try it out
19th Aug 2020, 4:55 PM
Nickson Osiemo
Nickson Osiemo - avatar