Advertisement
Guest User

Untitled

a guest
May 27th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3.  
  4. def en_sol_dip(myTree):
  5. sol = myTree[1]
  6. while True:
  7. if sol[1] == []:
  8. sol = sol[0]
  9. return sol
  10. break
  11. sol = sol[1]
  12.  
  13. myTree = ["a", #kok
  14. ["b", # sol altagac
  15. ["d",
  16. ["h",
  17. ["i",[],[]],
  18. ["j",[],[]]
  19. ]
  20. ],
  21. ["e",
  22. ["g",[],[]],
  23. []
  24. ]
  25. ],
  26. ["c", # sag altagac
  27. ["f",[],[]],
  28. []
  29. ]
  30. ]
  31.  
  32. print ("En sol dip:",en_sol_dip(myTree))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement