human
Convert the string into palindrome string by changing only one character | Function to check if it is possible to convert the string into palindrome.
Counting number of characters that should be changed ..
If count of changes is less than or equal to 1.
Driver Code"
How can the above be solved in Python?
 ... Give me a code to convert the string into palindrome string by changing only one character and the other steps required?
assistant
#Here is code to convert the string into palindrome string by changing only one character and the other steps required.
 def checkPalindrome ( str ) :
	n = len ( str )
	count = 0
	for i in range ( 0 , int ( n / 2 ) ) :
		if ( str [ i ] != str [ n - i - 1 ] ) :
			count = count + 1
	if ( count <= 1 ) :
		return True
	else :
		return False
str = " abccaa "
if ( checkPalindrome ( str ) ) :
	print ( " Yes " )
else :
	print ( " No " )