> 
> Write a Python program to get a string from a given string where all occurrences of its first char have been changed to '$', except the first char itself
> 
> 
> 

My code goes like this:

```
stringa = "restart" 

def swaping(palavra):
    prim = palavra[0] 
    for i in palavra:
        if prim in palavra and prim not in palavra[0]:
            palavra.replace(prim, "$") 
    return palavra 

print(swaping(stringa))

```

It should have returned `resta$t`, but it returned the same form, `restart`.

Does anyone have an idea why it won't work? The sample solution is completely different from mine, they chose to split the string in two and bind them together in the end.