1

I have a simple solution, but I think this is not the pythonic way. Do you have a suggestion?

def hasPath(myDict):
    try:
        myDict['A']['B']['C']
        return False
    except Exception:
        return True
Tavy
  • 861
  • 11
  • 15

0 Answers0