Tuesday 13 February 2024

Class 11 CS Practical - 30

 

30 - Write a program in Python to input a string and determine whether the string a palindrome or not.

S=input("Enter a string: ")

if S ==  S[::-1]:

    print("String is Palindrome")

else:

    print("String is not Palindrome")



No comments:

Post a Comment