Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Common Words by zgub4
def checkio(first, second):
a = first.split(",")
b = second.split(",")
final_list = list()
for word in a:
if word in b:
final_list.append(word)
final_list.sort()
final_words = ""
for word in final_list:
if final_words != "":
final_words += "," + word
else:
final_words += word
return final_words
if __name__ == '__main__':
assert checkio("hello,world", "hello,earth") == "hello", "Hello"
assert checkio("one,two,three", "four,five,six") == "", "Too different"
assert checkio("one,two,three", "four,five,one,two,six,three") == "one,three,two", "1 2 3"
Oct. 21, 2017