Palindrome Program in Python

Veröffentlicht am: 04 August 2019
auf dem Kanal: Example Program
177,532
3.6k

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
  / exampleprogram  
  / exampleprogram  
  / example_program  

Our Website
https://www.ExampleProgram.com

#PythonProgramming #ExampleProgram


Auf dieser Seite können Sie das Online-Video Palindrome Program in Python mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Example Program 04 August 2019 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 177,532 Mal angesehen und es wurde von 3.6 tausend den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!