Palindrom

PHOTO EMBED

Sun Nov 26 2023 18:44:56 GMT+0000 (Coordinated Universal Time)

Saved by @Matess08 #python

def res(vys):
    for x in vys:
        print(x)
try:
    s = int(input("s "))
    p = 0
    lst = []
    if s >=1 and s <=100:
        while p<s:
            z = input("z ")
            if len(z) >= 1 and len(z) <= 50:
                try:
                    num = int(z)
                    kys = type(num) == int
                except:
                    kys = z.isupper()     
                if kys == True:
                    pal = z[::-1]
                    if z == pal:
                        txt = "yes"
                    else:
                        txt = "no"
                else:
                    txt = "syntax"
            else:
                txt = "syntax"
            p = p+1
            lst.append(txt)
            print("")
        res(lst)
    else:
        print("syntax")
except:
    print("syntax")
content_copyCOPY

check if word is palindrom or not