题目
原文:
Write a method to decide if two strings are anagrams or not.
译文:
写一个函数判断两个字符串是否是变位词。
def anagrams(x, y):
x1 = list(x)
x1.sort()
x1 = ''.join(x1)
y1 = list(y)
y1.sort()
y1 = ''.join(y1)
if x1 == y1:
return True
else:
return False
2014-9-15