Skip to content

Commit a070536

Browse files
committed
unit6 pro2 solved
1 parent bd26bf8 commit a070536

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

unit6/pro2.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from opus7.tree import Tree
2+
3+
class treeCount(Tree):
4+
def getCount(self):
5+
if self.isEmpty:
6+
return 0
7+
return sum([self.getSubtree(i).count for i in xrange(self.degree)])

0 commit comments

Comments
 (0)