What is the function used to remove a character in any idex in string type

what is the function used to remove a character in any idex in string type

@mekala.akhil2468

You can remove a character from a Python string using replace() or translate(). Both these methods replace a character or string with a given value. If an empty string is specified, the character or string you select is removed from the string without a replacement.

my tought is how to remove a character in specified index like…

Write a Python program to remove the nth index character from a nonempty string

@mekala.akhil2468

def remove_char(str, n):
first_part = str[:n]
last_part = str[n+1:]
return first_part + last_part
print(remove_char(‘Python’, 0))
print(remove_char(‘Python’, 3))
print(remove_char(‘Python’, 5))