fork download
  1. def checkio(words_set):
  2. for word1 in words_set:
  3. for word2 in words_set:
  4. if word1.endswith(word2) and word1 != word2:
  5. return True
  6. else:
  7. return False
  8.  
  9. #These "asserts" using only for self-checking and not necessary for auto-testing
  10. if __name__ == '__main__':
  11. assert checkio({"hello", "lo", "he"}) == True, "helLO"
  12. assert checkio({"hello", "la", "hellow", "cow"}) == False, "hellow la cow"
  13. assert checkio({"walk", "duckwalk"}) == True, "duck to walk"
  14. assert checkio({"one"}) == False, "Only One"
  15. assert checkio({"helicopter", "li", "he"}) == False, "Only end"
  16. # your code goes here
Success #stdin #stdout 0.02s 8736KB
stdin
Standard input is empty
stdout
Standard output is empty