Def testword string result True strlen len string for i in
     Def test_word (string):  result = True  str_len = len (string)  for i in range (, int (str_len/2)):  if string[i] ! = string[str_len-i-1]:  result = False  break  return result  print(test_word(\'hello\'))  print(test_word(\'madam\'))  Output  ![Def test_word (string): result = True str_len = len (string) for i in range (, int (str_len/2)): if string[i] ! = string[str_len-i-1]: result = False break ret  Def test_word (string): result = True str_len = len (string) for i in range (, int (str_len/2)): if string[i] ! = string[str_len-i-1]: result = False break ret](/WebImages/29/def-testword-string-result-true-strlen-len-string-for-i-in-1082026-1761568367-0.webp) 
  
  Solution
the above logic is to test whether a string is palidrome or not
in the print statement ie:printf(test_word(\'hello\')); it will give false beacuse h!=o ,it will break the loop in the first iteration only
in the second print statement ie:printf(test_word(\'madam\')); ,it will give true beacuse in the first iteration m==m so condition satisfied next do the second iteration a==a ,it is satisfied and finally at last iteration d==d so at end it will give true.
![Def test_word (string): result = True str_len = len (string) for i in range (, int (str_len/2)): if string[i] ! = string[str_len-i-1]: result = False break ret  Def test_word (string): result = True str_len = len (string) for i in range (, int (str_len/2)): if string[i] ! = string[str_len-i-1]: result = False break ret](/WebImages/29/def-testword-string-result-true-strlen-len-string-for-i-in-1082026-1761568367-0.webp)
