我的代码是这样的:
text1 = "I like apple"
text2 = "I like car"
if text1 != text2:
print "the differences are:"the_difference
输出应为:
the differences are:car
感谢阅读
答案 0 :(得分:0)
text1 = "I like apple"
text2 = "I like car"
set1 = set(text1.split())
set2 = set(text2.split())
diffs = set1.symmetric_difference(set2)