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
  • 742
  • 9
  • 14

0 Answers0