try: zoo(3) try: print(zoo(1).foo(2)) except: print(zoo(0).foo(2)) except: pass