class Comp:
def __init__(self):
self.count = 0
self.message = {0: "before", 1: "after", 2: "too many"}
def challenge(self):
try:
print(self.message[self.count])
raise(Exception)
except KeyError:
print("Limit Reached")
except Exception:
self._func_for_error()
self.count += 1
def _func_for_error(self):
print("func_for_error")
c = Comp()
c.challenge()
c.challenge()
c.challenge()
c.challenge()
c.challenge()
Y2xhc3MgQ29tcDoKICAgIGRlZiBfX2luaXRfXyhzZWxmKToKICAgICAgICBzZWxmLmNvdW50ID0gMAogICAgICAgIHNlbGYubWVzc2FnZSA9IHswOiAiYmVmb3JlIiwgMTogImFmdGVyIiwgMjogInRvbyBtYW55In0KCiAgICBkZWYgY2hhbGxlbmdlKHNlbGYpOgogICAgICAgIHRyeToKICAgICAgICAgICAgcHJpbnQoc2VsZi5tZXNzYWdlW3NlbGYuY291bnRdKQogICAgICAgICAgICByYWlzZShFeGNlcHRpb24pCiAgICAgICAgZXhjZXB0IEtleUVycm9yOgogICAgICAgICAgICBwcmludCgiTGltaXQgUmVhY2hlZCIpCiAgICAgICAgZXhjZXB0IEV4Y2VwdGlvbjoKICAgICAgICAgICAgc2VsZi5fZnVuY19mb3JfZXJyb3IoKQogICAgICAgIHNlbGYuY291bnQgKz0gMQoKICAgIGRlZiBfZnVuY19mb3JfZXJyb3Ioc2VsZik6CiAgICAgICAgcHJpbnQoImZ1bmNfZm9yX2Vycm9yIikKCmMgPSBDb21wKCkKYy5jaGFsbGVuZ2UoKQpjLmNoYWxsZW5nZSgpCmMuY2hhbGxlbmdlKCkKYy5jaGFsbGVuZ2UoKQpjLmNoYWxsZW5nZSgp