There is a string, for example. EXAMPLE.
EXAMPLE
How can I remove the middle character, i.e., M from it? I don\'t need the code. I want to know:
M
def kill_char(string, n): # n = position of which character you want to remove begin = string[:n] # from beginning to n (n not included) end = string[n+1:] # n+1 through end of string return begin + end print kill_char("EXAMPLE", 3) # "M" removed
I have seen this somewhere here.