编写一个Python函数，该函数接受一个字符串和一个字符，并返回该字符串中该字符出现的次数。


字符串： “She sells seashells by the seashore.”
字符： “s”
```
def count_char(string, char):
    count = 0
    for i in string:
        if i == char:
            count += 1
    return count

string = "She sells seashells by the seashore."
char = "s"
print(count_char(string, char))
```

输出结果为：6