Problem: A string S of an odd length is said to be a _strong palindrome_ if and only if all of the following conditions are satisfied:    * S is a palindrome.   * Let N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.   * The string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.  Determine whether S is a strong palindrome.

Submission attempts (in order):
my_string = input("Type your word: ")
my_string = my_string.casefold()
if ((len(my_string)) < 3 or (len(my_string)) > 100):
    #print(len(my_string))
    print("no")
    quit()

reversed_string = reversed(my_string)

n = len(my_string)
#defining string [0:(n-1)/2]
first_chars = my_string[:int((n-1)/2)]
reversed_first_chars = reversed(first_chars)

#defining string [((n+3)/2):n-1]
last_chars = my_string[int((n+3)/2)-1:]
reversed_last_chars = reversed(last_chars)
#print(type(first_chars), first_chars)
#print(last_chars)
#print(n)

#checking if S is a palindrome
if list(my_string) == list(reversed_string):
    #checking if it is a strong palindrome
    if (list(first_chars) == list(reversed_first_chars)):
        if (list(last_chars) == list(reversed_last_chars)):
            print("yes")
        else:
            print("no")
    else:
        print("no")
#if it is not a palindrome at all
else:
    print("no")

my_string = input("Type your word: ")
my_string = my_string.casefold()
reversed_string = reversed(my_string)

n = len(my_string)
#defining string [0:(n-1)/2]
first_chars = my_string[:int((n-1)/2)]
reversed_first_chars = reversed(first_chars)

#defining string [((n+3)/2):n-1]
last_chars = my_string[int((n+3)/2)-1:]
reversed_last_chars = reversed(last_chars)
#print(type(first_chars), first_chars)
#print(last_chars)
#print(n)

#checking if S is a palindrome
if list(my_string) == list(reversed_string):
    #checking if it is a strong palindrome
    if (list(first_chars) == list(reversed_first_chars)):
        if (list(last_chars) == list(reversed_last_chars)):
            print("yes")
        else:
            print("no")
    else:
        print("no")
#if it is not a palindrome at all
else:
    print("no")

my_string = input("Type your word: ")
my_string = my_string.casefold()
if ((len(my_string)) < 3 or (len(my_string)) > 100):
    #print(len(my_string))
    print("no")
    quit()

reversed_string = reversed(my_string)

n = len(my_string)
#defining string [0:(n-1)/2]
first_chars = my_string[:int((n-1)/2)]
reversed_first_chars = reversed(first_chars)

#defining string [((n+3)/2):n-1]
last_chars = my_string[int((n+3)/2)-1:]
reversed_last_chars = reversed(last_chars)
#print(type(first_chars), first_chars)
#print(last_chars)
#print(n)

#checking if S is a palindrome
if list(my_string) == list(reversed_string):
    #checking if it is a strong palindrome
    if (list(first_chars) == list(reversed_first_chars)):
        if (list(last_chars) == list(reversed_last_chars)):
            print("Yes")
        else:
            print("No")
    else:
        print("No")
#if it is not a palindrome at all
else:
    print("No")


my_string = input()
my_string = my_string.casefold()
if ((len(my_string)) < 3 or (len(my_string)) > 100):
    #print(len(my_string))
    print("No")
    quit()

reversed_string = reversed(my_string)

n = len(my_string)
#defining string [0:(n-1)/2]
first_chars = my_string[:int((n-1)/2)]
reversed_first_chars = reversed(first_chars)

#defining string [((n+3)/2):n-1]
last_chars = my_string[int((n+3)/2)-1:]
reversed_last_chars = reversed(last_chars)
#print(type(first_chars), first_chars)
#print(last_chars)
#print(n)

#checking if S is a palindrome
if list(my_string) == list(reversed_string):
    #checking if it is a strong palindrome
    if (list(first_chars) == list(reversed_first_chars)):
        if (list(last_chars) == list(reversed_last_chars)):
            print("Yes")
        else:
            print("No")
    else:
        print("No")
#if it is not a palindrome at all
else:
    print("No")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted