Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # -*- coding: utf-8 -*-
- def en_sol_dip(myTree):
- sol = myTree[1]
- while True:
- if sol[1] == []:
- sol = sol[0]
- return sol
- break
- sol = sol[1]
- myTree = ["a", #kok
- ["b", # sol altagac
- ["d",
- ["h",
- ["i",[],[]],
- ["j",[],[]]
- ]
- ],
- ["e",
- ["g",[],[]],
- []
- ]
- ],
- ["c", # sag altagac
- ["f",[],[]],
- []
- ]
- ]
- print ("En sol dip:",en_sol_dip(myTree))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement