How can I check if a string has the same characters in Python?
str1 = 'caars' str2 = 'rats' str3 = 'racs' print(set(str1)==set(str2)) print(set(str1)==set(str3))
Output
False True
str1 = 'caars' str2 = 'rats' str3 = 'racs' print(set(str1)==set(str2)) print(set(str1)==set(str3))
False True