Input a string and determine whether it is a palindrome or not also convert the case of characters in a string.

string=input('enter the string')
length=len(string)
changedstring1=""
changedstring2=""
upto=int(length/2)+1
success=False
for j in range(0,upto):
    if(string[j]==string[length-1]):
        success=True
        if(ord(string[j])>=65 and ord(string[j])<=90):
            ascii=ord(string[j])+32
            changedstring1=changedstring1+chr(ascii)
            if(j<length-1):
             changedstring2=chr(ascii)+changedstring2
       if(ord(string[j])>=97 and ord(string[j])<=122):
           ascii=ord(string[j])-32
           changedstring1=changedstring1+chr(ascii)
           if(j<length-1):
             changedstring2=chr(ascii)+changedstring2
      length=length-1
      continue
    else:
       print('string is not palindrome')
       success=False
       for j in range(j,length):
           if(ord(string[j])>=65 and ord(string[j])<=90):
               ascii=ord(string[j])+32
               changedstring1=  changedstring1+                             chr(ascii)
           if(ord(string[j])>=97 and ord(string[j])<=122):
               ascii=int(ord(string[j])-32)
               changedstring1= changedstring1+                             chr(ascii)
       break
if(success==True):
    print('string is palindrome')
    print('case converted string', changedstring1+          changedstring2)
else:
    print('case converted string ',changedstring1)
 
Explanation: In this program we have taken input string from user. Palindrome is a text which is same whether read from either side, left to right or from right to left. Ex abcba, addcdda or 2341432 etc. 
 
First we have found length of string using len() function and taken 2 string variables to store the case converted string from both sides in case string is palindrome otherwise only one string variable is required to store it.
 
upto variable is used in for loop to define range upto which loop will execute. We run it till half of length of string, because other half is running from other end of string using length variable. We are matching each character from both the ends.
 
Loop will execute till characters are matching, otherwise control reaches else conditional construct part of loop. Inside if conditional we are converting case of letters using ord and ASCII functions. Ord returns ASCII value and ASCII returns character of ASCII value. 
 
Uppercase letters are in between range of 65 to 90 and lowercase letters are in between 97 to 122 ASCII value range. So we have used conditionals accordingly and storing the case converted characters in string variables from both the sides.
 
In else part of outer loop, we are running a inner loop to convert the leftover characters of the input string , in case string is not palindrome.this way whole input string is case converted.
 
In last if conditional we are checking success flag for palindrome. If yes then case converted string is shown by adding changedstring1 and changedstring2 for both the sides, otherwise changedstring1 is enough to show case converted string.