Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
The_end...of_other solution in Uncategorized category for The End of Other by arkadiusz.nadolski
def checkio(words_set):
result = 0
if len(words_set) == 1:
return False
else:
for i in words_set:
for j in words_set - {i}:
if i.endswith(j):
result += 1
if result>0:
return True
else:
return False
#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"
Jan. 25, 2016