This code doesn't work on trinket

Hi @Gghh45 and welcome to the forums.

You’ll notice that the code you posted is difficult to read. In particular it is difficult to see the loops and indenting. Here’s how to make it readable for everyone: Python Discourse Quick Start . You can probably edit your original post so as to make it look right.

In what way does it not work? If it stops on an error message, paste it in (like code). If it doesn’t do what you expect, show us an interaction.

Printing out repr(choice) and repr(safe_egg) just before if choice == safe_egg: would probably help you debug it. I suggest using the repr function because comparing strings is tricky. There can be spaces or new lines you don’t expect (and may not notice if you only print the string).