Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Common Words by Anna_Barys
def checkio(first, second):
new = []
Lfirst = first.split(",")
Lsecond = second.split(",")
for i in range (len(Lfirst)):
for j in range (len(Lsecond)):
print(Lfirst[i],Lsecond[j])
if Lfirst[i] == Lsecond[j]:
new.append(Lfirst[i])
else:
x = 0
new.sort()
print(new)
neww = ','.join(new)
print(neww)
return neww
#These "asserts" using only for self-checking and not necessary for auto-testing
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"
Jan. 1, 2016