Check out my code and tell me where's the error. Thank you.
def checkio(words_set):
if len(words_set) == 1:
return False
for suffix in words_set:
for word in words_set:
if suffix != word:
return word.endswith(suffix)
#These "asserts" using only for self-checking and not necessary for auto-testing
if __name__ == '__main__':
assert checkio({"hello", "lo", "he"}) == True, "helLO"
assert checkio({"hello", "la", "hellow", "cow"}) == False, "hellow la cow"
assert checkio({"walk", "duckwalk"}) == True, "duck to walk"
assert checkio({"one"}) == False, "Only One"
assert checkio({"helicopter", "li", "he"}) == False, "Only end"
Created at: May 15, 2014, 9:10 a.m.; Updated at: June 16, 2014, 5:03 p.m.