Given a string and an index, we have to remove the character from given index in the string using python program.
Here, we would learn how we can remove a character from an index in a string easily?
Question:
We are provided a non-empty string and an integer N, such that we have to return a string such that the character at the given index (N) has been removed. Where N belongs to the range from 0 to len(str)-1.
Example:
remove_char ('raman', 1) = 'rman'
remove_char ('raman', 0) = 'aman'
remove_char ('raman', 4) = 'rama'
Code:
Output
need an explanation for this answer? contact us directly to get an explanation for this answer