Advertisement
ralphdc09

its102.md.wk.11.fn.13.number01

Nov 26th, 2021
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. class PythonLabActivity:
  2.     def sub_sets(self, sset):
  3.         return self.subsets_recur([], sorted(sset))
  4.  
  5.     def subsets_recur(self, current, sset):
  6.         if sset:
  7.             return self.subsets_recur(current, sset[1:]) + self.subsets_recur(current + [sset[0]], sset[1:])
  8.         return [current]
  9.  
  10.  
  11. for name in PythonLabActivity.__dict__:
  12.     print(name)
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement