Function name: (Parameter types) -> Return type bun_packages_required: (int) -> int Description: There are ten hot dogs in a package of hot dogs and eight buns in a package of buns. Return the number of packages of hot dog buns needed for the given number of packages of hot dogs (assuming one hot dog per bun). Note: you should import math in order to use a function from that module. i have to do this using python, does anyone have an idea of what coding i could possibly create? i'm a beginner
Have you managed to solve this problem on paper first? I believe the difficulty of this problem lies in the math aspect and not the programming aspect of it.
Tip: Least Common Multiple
ye no i understand what i have to find im just confused on what i should use to reiterate it on the program because he wants us to use the math function from the import and what not
I see... Please post your implementation and we can then review it and help you with it!
Maybe you could use the gcd function of the fractions library!
Sorry to be a pain... but if I just give you the answer, then you won't learn anything. If you don't want to think at all, send me a message and I will give you the answer there!
My original thought on this would be something like. If the modulus of hot dogs and buns is greater than 0 then the answer is 1 more than the absolute of hot dogs divided by buns. This pseudocode is then relatively easy to change into actual code. Now, looking at the math function I also found math.modf that can be used similarly.
Join our real-time social learning platform and learn together with your friends!