Python program for checking palindrome without reverse function.

Published: 25 March 2021
on channel: Ritik Kumar
646
22

Here is the code:-
#method1
str=input("Enter the string: ")
if str[::]==str[::-1]:
print("The string is a palindrome.")
else:
print("String is not a palindrome.")

#method2
str=input("Enter the string: ").lower()
l=len(str)
x=[]
n=list(str)
for i in range(l-1,-1,-1):
g=str[i]
x.append(g)
if x==n:
print("string is a palindrome.")
else:
print("string is not a palindrome.")


On this page of the site you can watch the video online Python program for checking palindrome without reverse function. with a duration of hours minute second in good quality, which was uploaded by the user Ritik Kumar 25 March 2021, share the link with friends and acquaintances, this video has already been watched 646 times on youtube and it was liked by 22 viewers. Enjoy your viewing!