Check If A String Is A Palindrome | Python Example

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

You explained the positional comparison with such clarity - thank you. My Python tutor explained in a manner I failed to understand.

fatimawadee
Автор

Clear, simple and substantive explanation. Thanks!

antonisledziewski
Автор

Such a clear explanation.. thank you so much dear sir :)

Phoenix-lgmr
Автор

best so far! Thanks so much for the awesome explanation🙏

folakemiumar
Автор

Thank you, Great Explanation. What about the time complexity ?

shikshyasharma
Автор

THANK YOU SO MUCHHH ❤😊 THIS HELPED A LOT

herzel
Автор

this helps, but what about if the input is a phrase or sentence instead? like "never odd or even"

danstang
Автор

Can you just reverse the string using string1[::-1] then check?

word = str(input(“Enter word: “))

if word == word[::-1]:
print(“The word, ”, word, ” is a palindrome”)

else:
print(“The word, ”, word, ” is not a palindrome”)

Akhimed
Автор

Thank you a lot! It was really helpful!

bunyodkodirov