+ 1

please how do you solve popsicles while using python

5th Jun 2020, 6:18 PM
Timi Toba
Timi Toba - avatar
3 Answers
+ 4
Hello Toba Timilehin. It is very easy, but you must analyze in order to understand how problems are solved, otherwise you will not learn. I leave you the code, but please for your sake, analyze it before solving it. https://code.sololearn.com/cP4SfvnDgf7v/?ref=app
5th Jun 2020, 6:25 PM
Josshual A. Toro M.
Josshual A. Toro M. - avatar
+ 2
Check if the number of popsicles is divisible by the number of siblings, that's all.
5th Jun 2020, 6:21 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
+ 2
Toba Timilehin You can also use a Python ternary: print ("give away" if popsicles % siblings == 0 else "eat them yourself") look up how they work, they can be very usefull.
5th Jun 2020, 9:03 PM
Paul K Sadler
Paul K Sadler - avatar