Complete the solution so that it strips all text that follows any of a set of comment markers passed in. Any whitespace at the end of the line should also be stripped out. 
**Example:**
Given an input string of:
```
apples, pears # and bananas
grapes
bananas !apples
```
The output expected would be:
```
apples, pears
grapes
bananas
```
The code would be called like so:
```python
result = solution("apples, pears # and bananas\ngrapes\nbananas !apples", ["#", "!"])
# result should == "apples, pears\ngrapes\nbananas"
```
def solution(string,markers):
    lst = string.split('\n')
    for i, s in enumerate(lst):
        for m in markers:
            f = s.find(m)
            s = s[0:f] if f >= 0 else s[:]
        lst[i] = s.strip()

    return '\n'.join(lst)

def solution(string,markers):
    lst = string.split('\n')
    for i, s in enumerate(lst):
        for m in markers:
            f = s.find(m)
            s = s[0:f] if f >= 0 else s[:]
        lst[i] = s.strip()

    return '\n'.join(lst)
