我想,给定您的代码,您想检查回文,而不是制作回文。
您的代码存在许多问题,但简而言之,它可以减少到
word = input()
if word == "".join(reversed(word)):
print("Palidrome")
让我们谈谈你的代码,这没有多大意义:
fno = input()
myList = list(fno) #fno will be a string, which is already a sequence, there is no need to make a list.
sum = 0 #This goes unused. What is it for?
for i in range(len(fno)): #You should never loop over a range of a length, just loop over the object itself.
if myList[0:] == myList[:0]: #This checks if the slice from beginning to the end is equal to the slice from the beginning to the beginning (nothing) - this will only be true for an empty string.
continue #And then it does nothing anyway. (I am presuming this was meant to be indented)
print (myList) #This will print the list of the characters from the string.