Guest User

Untitled

a guest
Oct 18th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. {'definition': 'dirname',
  2. 'get': ['getatime', 'getctime', 'getmtime', 'getsize'],
  3. 'operation': ['join',
  4. {'split':['split', 'splitdrive', 'splitext']},
  5. {'expand': ['expanduser', 'expandvars']},
  6. ],
  7. }
  8.  
  9. lst = []
  10. def count_d(dt):
  11. global lst
  12. if isinstance(dt, dict):
  13. for value in dt.values():
  14. if isinstance(value, str):
  15. lst.append(value)
  16. else:
  17. count_d(value)
  18. elif isinstance(dt,list):
  19. for ele in dt:
  20. if isinstance(ele, str):
  21. lst.append(ele)
  22. else:
  23. count_d(ele)
  24. return lst
  25.  
  26. lst = []
  27. def count_d(dt):
  28. global lst
  29. for ele in dt:
  30. if isinstance(ele,str):
  31. lst.append(ele)
Add Comment
Please, Sign In to add comment