Advertisement
Guest User

Untitled

a guest
May 20th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. def empty_test(list_of_iterables):
  2. if not list_of_iterables:
  3. return True
  4. else:
  5. return [*list_of_iterables[0]] == [] and empty_test(list_of_iterables[1:])
  6.  
  7. assert empty_test(['', (), {}, iter([])]) == True
  8. assert empty_test(['foo']) == False
  9. assert empty_test([iter([])]) == True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement