Answer:
name = input("Enter the name of file: ")
f = open(name, "r")
for line in f.readlines():
foundPalindrome = True
line = line.strip()
line = line.lower()
i=0
for j in range(len(line)-1,-1,-1):
if i>= j:
break
if line[i] != line[j]:
foundPalindrome = False
break
i+=1
if foundPalindrome:
print(line," is a Palindrome")
else:
print(line," is a not Palindrome")
Explanation: