how to check all the characters are same in the given string in python code example Example: how to check if all characters in string are same python s == len(s) * s[0]