if one string has one character check if other string has also one character code example Example: how to check if all characters in string are same python s == len(s) * s[0]