# L-15 MCS 260 Mon 15 Feb 2010 : oracle.py # # With lambda forms we can make functions # that return functions. # def make_oracle(): "returns an oracle as a lambda form" n = input('Give secret number : ') f = lambda x: x == n return f oracle = make_oracle() while True: g = input('Guess the secret : ') if oracle(g): break print 'wrong, try again' print 'found the secret'