def question2(a):
    """
    Given a string a, find the longest palindromic substring contained in a.
    :param a: initial string
    :return: longest palindromic substring in a
    """

    if a == None:
        return None
    elif len(a) < 2:
        return a

    biggest = (0, "")

    for num in range(len(a)):
        for iter in range(num + 1, len(a)):
            check = a[num:iter]
            if len(check) > biggest[0] and check == check[::-1]:
                biggest = (len(check), check)

    return biggest[1]