Avatar ·

The task is "palindrome". Python

📁 string, Advanced Python Topics, example

Task: given a string, determine whether it is a palindrome (i.e., whether it reads the same from left to right and right to left)

Input the input is given without spaces. The length of the string does not exceed 200. Letters of different cases are considered different.

Output must output YES if the string is a palindrome, and NO otherwise.

Example:

Abba YES

qwerq NO

  word =  str  ( input  ()) x =  len  (word) i =  0  x = x -  1  k =  0