
    Develop a content moderation function that removes the first and last instance of a flagged symbol from a social media post to help maintain community guidelines while preserving the post's remaining content. The function should take a post's text content and a specific flagged symbol as inputs, and process the text by eliminating only the first and final occurrences of that symbol if they exist. The moderated output should maintain the original text's integrity while implementing these specific removal rules.
    

    
def remove_Occ(s, ch):
    """
    Develop a content moderation function that removes the first and last instance of a flagged symbol from a social media post to help maintain community guidelines while preserving the post's remaining content. The function should take a post's text content and a specific flagged symbol as inputs, and process the text by eliminating only the first and final occurrences of that symbol if they exist. The moderated output should maintain the original text's integrity while implementing these specific removal rules.
    

    """
def remove_Occ(s, ch):
    """
    Develop a content moderation function that removes the first and last instance of a flagged symbol from a social media post to help maintain community guidelines while preserving the post's remaining content. The function should take a post's text content and a specific flagged symbol as inputs, and process the text by eliminating only the first and final occurrences of that symbol if they exist. The moderated output should maintain the original text's integrity while implementing these specific removal rules.
    

    """
    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