Question: 
Write a python function to remove first and last occurrence of a given character from the string.


Model's Code:
def remove_Occ(s, char):
    first = s.find(char)
    last = s.rfind(char)
    if first != -1 and first != last:
        return s[:first] + s[first+1:last] + s[last+1:]
    elif first == last and first != -1:
        return s[:first] + s[first+1:]
    return s



Sample Correct Code:
def remove_Occ(s,ch): 
    for i in range(len(s)): 
        if (s[i] == ch): 
            s = s[0 : i] + s[i + 1:] 
            break
    for i in range(len(s) - 1,-1,-1):  
        if (s[i] == ch): 
            s = s[0 : i] + s[i + 1:] 
            break
    return s 


Asserts:
assert remove_Occ("hello","l") == "heo"
assert remove_Occ("abcda","a") == "bcd"
assert remove_Occ("PHP","P") == "H"


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: PASS

Test 11 of 974: 8/11 (72.72727272727273%): success