1st method:
checks that all elements present in string1 are also present in string2 while ensuring the lengths are the same
def is_anagram(s1, s2):
x= all(i in s2 for i in s1)
if x and len(s1) == len(s2):
return True
return False
2nd method:
lambda function
a = 'spin'
b = 'pins
anagram = lambda x,y: sorted(x)==sorted(y)
print(anagram(a,b))