import string


def removePunctuations(target):
    """
    this function takes in a string, and returns it after removing all
    leading and trailing punctuations

    string.punctuation !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

    logic: to find a starting index and ending index to slice the string
    """
    # initialise start and end variable
    start = 0
    end = len(target)
    # find the first non-punctuation char
    for i in range(end):
        if target[i] not in string.punctuation:
            start = i
            break
    # find the last non-punctuation char
    while end >= 1:
        if target[end - 1] not in string.punctuation:
            break
        end -= 1
    # slice the string and return
    return target[start:end]