How to check if a two numbers are Anagram or not

Check if a two numbers are Anagram or not

Input:
val1 = '240'
val2 = '420'


Source Code:
if set(val1) == set(val2):
    print("both numbers form anagram")
else:
    print("both numbers doesn't from anagram")


Output:
both numbers form anagram
 

Comments