Skip to content

Conversation

@SuperLakshya
Copy link

Created a new short and easy way to check if a string is a palindrome or not

st = input("Enter a word:")
j = -1
g = 0
for i in st:
if i != st[j]:
j = j - 1
g = 1
break
j = j - 1
if g == 1:
print("It's not a palindrome")
else:
print("It's a palindrome")

Created a new short and easy way to check if a string is a palindrome or not
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant