human
Give me a code to check if there exists any sub and the other steps required given the following:
Check if there exists any sub | Function to check if there exists at least 1 sub - sequence in a string which is not palindrome.
use set to count number of distinct characters.
insert each character in set.
If there is more than 1 unique characters , return true.
Else , return false.
Driver code"
How can the above be solved in Python?
assistant
#Here is code to check if there exists any sub and the other steps required.
 def isAnyNotPalindrome ( s ) :
	unique = set ( )
	for i in range ( 0 , len ( s ) ) :
		unique . add ( s [ i ] )
	if ( len ( unique ) > 1 ) :
		return True
	else :
		return False
if __name__ == ' _ _ main _ _ ' :
	s = " aaaaab "
	if ( isAnyNotPalindrome ( s ) ) :
		print ( " YES " )
	else :
		print ( " NO " )