Please Rectify The Error
Question: Change in Case- You will be given a single string and two positive integers denoting indices. You need to change the case of the characters at those indices.i.e change uppercase to lowercase and lowercase to uppercase. It is guaranteed that all characters in the string are alphabets. Input The first line contains N, the length of string. The next line contains a single string. Two integers, x and y, in next line separated by space. Sample Input 6 Dcoder 0 3 Output Print the string after altering the case of characters at those indices. Sample Output dcoDer Constraints- 1 <= string.length <= 40 O <= x, y <= string.length --- My Solution: Help me rectify the error, please... Input: lnstr = int(input()) strn = str(input()) x = int(input()) y = int(input()) if strn[x].isupper(): a = strn[x].lower() else: a = strn[x].upper() if strn[y].isupper(): b = strn[y].lower() else: b = strn[y].upper() print(strn.replace(strn[x],a).replace(strn[y],b)) --- Output: 6 Dcoder 0 3 DcoDer