Python Program to Check Whether a String is Palindrome or Not.
In this program. you'll learn to check whether a string is palindrome or Not.
Note: To test the program, change the value of my_str in the program.
In this program, we have taken a string stored in my_str.
Using the method casefold() we make it suitable for caseless comparisons. Basically, this method returns a lowercased version of the string.
We reverse the string using the built-in function reversed(). Since this function returns a reversed object, we use the list() function to convert them into a list before comparing.
#shorts #coding #python
#programming #python_coding
In questa pagina del sito puoi guardare il video online #python della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Code Analysis 18 febbraio 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 193 volte e gli è piaciuto 15 spettatori. Buona visione!