PYTHON -Program to check if a string is palindrome

Pubblicato il: 17 agosto 2020
sul canale di: Technical RPA
304
5

Python program to check if a given string is palindrome or not
#Python program to check if a string is palindrome or not

#Given a string, write a python function to check if it is palindrome or not.
#A string is said to be palindrome if the reverse of the string is the same as string.
#For example, “radar” is a palindrome, but “radix” is not a palindrome.


#Examples:

#Input : malayalam
#Output : Yes

#Input : tea
#Output : No

def isPalindrome(word):
return word == word[::-1]


Driver code
word = "malayala"
ans = isPalindrome(word)

if ans:
print("Yes")
else:
print("No")


In questa pagina del sito puoi guardare il video online PYTHON -Program to check if a string is palindrome della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Technical RPA 17 agosto 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 304 volte e gli è piaciuto 5 spettatori. Buona visione!