Last year Microsoft organised a hackathon. The attendees made puzzles to test AI’s programming proficiency. Each puzzle takes the form of a Python function that takes an answer as an argument. The answer is an input which makes the function return True. This is called satisfying the puzzle, and that is why the puzzles are all named sat. Can you figure out a required input for the functions?
def sat(x: str): return 'Hello ' + x[::-1] == 'Hello world'
def reverse(s): return s[::-1] sat(reverse("world"))
def sat(x): try: x(123) return False except RandomException: return True except: return False
def sat(one, two, three): return one(two) == three and one(two(three)) == two and two != three
def sat(x): return x > x and x + 1 == x
class RandomException(Exception): pass def foo(string): raise RandomException sat(foo)
def how(x): return 1 if x is dee else dee def dee(x): return x sat(how, dee, 1)
class Var: def __gt__(self, other): return True def __add__(self, other): return 1 def __eq__(self, other): return True bob = Var() sat(bob)