Palindrome Program in Python

preview_player
Показать описание
This video demonstrates how to write a Python program to check for a palindrome. A palindrome is a string or sequence of characters that reads the same backward as forward. For example, the string "m a d a m - madam" is a palindrome if reversed, and the number 1 2 1 is a palindrome if reversed.

The program asks the user to enter a string, which is then reversed and stored in a variable called "s". The input function reads the user's input in string form, and the reversed value is then stored in the "reverse" variable.

The slicing method is used to slice the entire string without specifying the starting and ending points. The step is set to minus 1, which reverses the string and stores it in the "reverse" variable.

To check if the original value entered by the user is equal to the reverse, the if conditional statement is used. If the reverse is equal to the original value, the program is a palindrome. If the reverse is not equal to the original value, the program is not a palindrome.

our Social Media Pages

Our Website

#PythonProgramming #ExampleProgram
Рекомендации по теме
Комментарии
Автор

You made this super simple to understand. Now I can do a deep dive on this concept now that I know the basic concept. Thank you sir for this video. Greatly appreciate it.

judeaf.
Автор

this question was asked in amazon interview

vishnureddy
Автор

please do not say if u dont like it hit dislike coz there isnt any point of disliking ur explanation great one mate

ajitmoseschaparla
Автор

the code for this same program is given in a very big way in cbse. urs is super small and suuuper simple. thank u for the help.

jasonthomas
Автор

Thank you so much for this simple method. I was literally struggling with this and tomorrow's my exam. Your video helped me so much. Thank you for this.
You are so underrated, dude. Keep going.💪🏻

meyou
Автор

Thanks sir 😊 my teacher teach this topic in very difficult manner, you made this easy thanks a lot sir👏👏🌹🍾

solvewithme
Автор

Couldn't find the class notes so i came to yt...directly found the easiest way... thank you bro!!

INFINITE_VOID_
Автор

Super simple, , , i just subscribed your channel because of this program otherwise at my school it is super lengthy and confusing

RanjanLal_
Автор

Broo, it is amazing...So simple to understand your explanation is superb...❤

lovelyvenkat
Автор

you can understand student's feeling...thank you

vedantstudy_
Автор

You saved my grade.I was really challenging myself to understand palindrome and i used a different method for string and number, but the code you explained works for both string and number at once.thanks alot

samuelabera
Автор

this was so easy to understand!!! thank you!!!

malavikarnambiar
Автор

thanku sir,
its much better usefull beginner like me. understanding in very easy way.

vineethkurapati
Автор

I think this is one of the easiest methods. Other methods involve taking the length of the word, dividing it by 2, and some further processes.

ranubis
Автор

Thank yuo so much brother
it was very very useful

karthickvishal
Автор

Bro you are a very very very .... good python programmer 👍👍

DIFFERENTCREATOR
Автор

Thank you so much for this sir it was the easiest way to understand

anishdiwaker
Автор

Great vid, "if you didnt like then hit the dislike button" really got me

VihaanBudhraja
Автор

bro do you now why it doesn't work with 'eval' command? the video is very usefull thanks

davidee
Автор

Hello
I find your tutorial so easy to understand.
If I need a help for a particular problem, how can I reach you pls?

arabiamir