Skip to content

Commit adca5cb

Browse files
authored
Create suffix
1 parent 3156b28 commit adca5cb

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

suffix

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
def checkio(words_set):
2+
for w1 in words_set:
3+
for w2 in words_set:
4+
if w1 == w2:
5+
continue
6+
elif w1.endswith(w2)==1:
7+
return True
8+
9+
return False
10+
11+
#return True or False
12+
13+
#These "asserts" using only for self-checking and not necessary for auto-testing
14+
if __name__ == '__main__':
15+
assert checkio({"hello", "lo", "he"}) == True, "helLO"
16+
assert checkio({"hello", "la", "hellow", "cow"}) == False, "hellow la cow"
17+
assert checkio({"walk", "duckwalk"}) == True, "duck to walk"
18+
assert checkio({"one"}) == False, "Only One"
19+
assert checkio({"helicopter", "li", "he"}) == False, "Only end"

0 commit comments

Comments
 (0)