# L-15 MCS 260 Mon 1 Oct 2007 : an oracle # # 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'