Created
March 19, 2024 16:06
-
-
Save MahraibFatima/f5910c4b5b8770a98b200e95965cc3b7 to your computer and use it in GitHub Desktop.
Determine whether the entered string is a palindrome or not.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_palindrome(s): | |
return s == s[::-1] | |
string = input("Enter a string: ") | |
if is_palindrome(string): | |
print("Palindrome") | |
else: | |
print("Not a palindrome") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment