Python through Hackerrank|Mutations

I have tried to solve this but it is giving runtime error.
In this code, we have to change a specified index by a specified character in a string. I am confused with the syntax part can anyone help?

I have written this code and it is giving “EOF error”:

def mutate_string(string, position, character):
    s = input()
    i,k = input().split()
    print (s[:int(i)]+k+s[int(i)+1:])
    if __name__ == '__main__':
        s = input()
        i, c = input().split()
        s_new = mutate_string(s, int(i), c)

The first issue is that you can’t place your main check inside of your function definition:

def mutate_string(string, position, character):
    s = input()
    i,k = input().split()
    print (s[:int(i)]+k+s[int(i)+1:])


if __name__ == '__main__':
  s = input()
  i, c = input().split()
  s_new = mutate_string(s, int(i), c)

From there, it looks like you have some syntax and logic issues. I don’t that that your use of split works unless two words were typed in, for example.