Python Program For String Palindrome

Python Program For String Palindrome

Published on October 21 2021

In this tutorial, you will learn a python program to check if a given string is Palindrome or not by reversing the string using the slice method.

Source code

user_input = input("Enter any String :")

reverse_string = user_input[::-1]
if(user_input == reverse_string):
    print("Given String is Palindrome")
else:
    print("It is not Palindrome.")

Video