Math programming with python -
so i'm pretty new programming , don't understand how problem. egg cartons each hold 12 eggs. write program reads integer number of eggs input(), prints out 2 numbers: how many cartons can filled these eggs, , how many eggs left over. appreciate help!
at first, looking modulo operator , function math.floor()
modulo
from wikipedia:
in computing, modulo operation finds remainder after division of 1 number (sometimes called modulus).
for example:
12%12=0 24%12=0 25%12=1
this fit needs eggs leftover.
math.floor()
returns largest following integer.
eg.:
math.floor(13/2)
would same as
math.floor(6.5)
and result in 6.
this function should solve problem filled egg cartons.
hint
remember import floor() properly.
from math import floor
first, try figure rest out on own.
you shouldn't @ until code done. either way i'm not mom, if wanna die dumb tried prevent it.
https://github.com/aiyionprime/eggcartons
one last thing. not matter wether attempts solve problem stupid or failed hard. if ever expect answer 1 of problems should explain tried. we're not here solve problems, understand it.
Comments
Post a Comment