"""
TECC prototype:

4D Puzzler:  Egg Hunt

The following namespace has been defined:
"""

class Egg:

    def __init__(self, thething):
        self.__secret_prize = thething

    @property
    def prize(self):
        return self.__secret_prize

        
egg = Egg("********")

struct = ( [ ( { 'a' : 1 }, { 2: 'a'} ), { ('a') : [ ] } , ] , [ {3 : egg} ] )

"""
Now reach into struct using indexing to get the
secret contents of the egg, using a one line
expression.

One possible answer:

>>> struct[1][0][3].prize
'********'

another:

>>> struct[1][0][3]._Egg__secret_prize
'********'
"""

4D:k!
_______________________________________________
Edu-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/edu-sig

Reply via email to