fork(2) download
  1. # your code goes here
  2. def is_in_list(word, word_list):
  3. for row in word_list:
  4. if word in row and word != row:
  5. return True
  6. return False
  7.  
  8. def get_word(word, is_removed):
  9. if is_removed is not True:
  10. return word
  11.  
  12. def remove(word_list, is_removed):
  13. for word, is_removed in zip(word_list, is_removed):
  14. if is_removed is False:
  15. yield word
  16.  
  17. word_list = ['abc','abcd','bcd','bbt','yyf','zat']
  18. is_removed = map(is_in_list, word_list, [word_list for row in range(len(word_list))])
  19. result = remove(word_list, is_removed)
  20. print(list(result))
Success #stdin #stdout 0.1s 10104KB
stdin
Standard input is empty
stdout
['abcd', 'bbt', 'yyf', 'zat']