Python Challenge - Egg Dropper

This community-built FAQ covers the “Egg Dropper” code challenge in Python. You can find that challenge here, or pick any challenge you like from our list.

Top Discussions on the Python challenge Egg Dropper

There are currently no frequently asked questions or top answers associated with this challenge – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this challenge. Ask a question or post a solution by clicking reply () below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this challenge, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

You can also find further discussion and get answers to your questions over in #get-help.

Agree with a comment or answer? Like () to up-vote the contribution!

Need broader help or resources? Head to #get-help and #community:tips-and-resources. If you are wanting feedback or inspiration for a project, check out #project.

Looking for motivation to keep learning? Join our wider discussions in #community

Found a bug? Report it online, or post in #community:Codecademy-Bug-Reporting

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Is this prompt correct? The worst case number of drops for finding the correct floor seems to be at most 7 or 8, unless I’m really misinterpreting it.

Assuming n=100, always start with floor 50, then guess the floor halfway up or down the direction you need to go.

Now, assume that you start with the 50th floor and the egg breaks. The worst case scenario is if f = 51. Use (B) for breaks and (N) for not-break:

50(B) → 75(N) → 62(N) → 55(N) → 51(B) → 53(N) → 52(N) [Now we know f = 51.]

I’m rounding the distance moved up in this example. Depending on some other edge cases, perhaps the minimum number is really 8 instead of 7 as in this example… I just don’t see any scenario where you would need 14 guesses.

So, please let me know if I have the wrong idea about what this problem is asking. Or if I have the right idea, show me how my algorithm would take 14 steps to find f (or show why my algorithm won’t find the correct answer for some reason).

1 Like

I thought that as well initially but you only have two eggs to use not 7,
if anyone figures it out reply to my comment im stuck