Skip to content

Instantly share code, notes, and snippets.

@IuryAlves
Created June 13, 2018 04:26
Show Gist options
  • Select an option

  • Save IuryAlves/b8718fc16f50916e55b506fd7f9b1a5b to your computer and use it in GitHub Desktop.

Select an option

Save IuryAlves/b8718fc16f50916e55b506fd7f9b1a5b to your computer and use it in GitHub Desktop.

Revisions

  1. iury created this gist Jun 13, 2018.
    10 changes: 10 additions & 0 deletions depth.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    def get_depth(self):
    parent = self.parent
    depth = 0
    while parent is not None:
    parent = parent.parent
    depth += 1
    return depth


    # coloca isso na classe Link