python check if string has 2 chars equals and followed code example Example: how to tell if two numbers have the same characters python sorted(str1) == sorted(str2)