This simple code that simply tries to replace semicolons (at i-specified postions) by colons does not work:
for i in range(0,len(line)): if (line[i]==\"
To replace a character at a specific index, the function is as follows:
def replace_char(s , n , c): n-=1 s = s[0:n] + s[n:n+1].replace(s[n] , c) + s[n+1:] return s
where s is a string, n is index and c is a character.