Skip to content

Instantly share code, notes, and snippets.

@MahraibFatima
Created March 19, 2024 16:06
Show Gist options
  • Save MahraibFatima/f5910c4b5b8770a98b200e95965cc3b7 to your computer and use it in GitHub Desktop.
Save MahraibFatima/f5910c4b5b8770a98b200e95965cc3b7 to your computer and use it in GitHub Desktop.
Determine whether the entered string is a palindrome or not.
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