def checkio(first, second):
first = first.split(",")
second = second.split(",")
same = [i for i in first if i in second]
return ",".join(i for i in sorted(same)) if same else ""
This is how I passed the project but my question is why this code is wrong?
def checkio(first, second):
first = first.split(",")
second = second.split(",")
same = [i for i in first if i in second].sort()
return ",".join(i for i in same) if same else ""
Created at: June 15, 2016, 12:34 p.m.; Updated at: June 20, 2016, 4:08 a.m.