I have been trying to write this program for a  [codewars problem/kata](https://www.codewars.com/kata/54b42f9314d9229fd6000d9c/train/python) which reads a string, and converts the string to a new string where each character in the new string is "(" if that character appears only once in the original string, or ")" if that character appears more than once in the original string. Ignore capitalization when determining if a character is a duplicate.

So, below is the small code I wrote, before starting to work towards the bigger part of the problem:

```
a = "Eren"
b = a.lower()
for i in b:
    c = b.count(i)
    print(c)
    if c == 1:
        d = b.replace(i, "(")
    else:
        d = b.replace(i, ")")

print(d)

```

I was expecting the output to be

```
)()(

```

But what I get is

```
ere(

```

What am I doing wrong?