ᴡʀɪᴛᴇ ᴀ ᴄᴏᴅᴇ ᴛᴏ ᴄʜᴇᴄᴋ ᴀ sᴛʀɪɴɢ ᴘᴀʟɪɴᴅʀᴏᴍᴇ ᴏʀ ɴᴏᴛ? in python
Answers
Answered by
2
Answer:
a=(input("enter a string: "))
b=a[-1::-1]
if (a==b):
print(" Palindrome string")
else:
print(" Not a Palindrome string")
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
Explanation:
Palindrome means if the string is reversed then the result would not be changed . For example ;- MADAM, if this word is reversed then it will remain as it is.
Answered by
5
Answer:
Go through the attachment...
Attachments:
Similar questions