Answers for "palindrome logic in python"

14

string palindrome in python

n = input("Enter the word and see if it is palindrome: ") #check palindrome
if n == n[::-1]:
    print("This word is palindrome")
else:
    print("This word is not palindrome")
Posted by: Guest on December-21-2020
3

python palindrome

def palindrome(a):
    return a == a[::-1]

palindrome('radar') 		# True
Posted by: Guest on February-16-2021
0

palindrome in python

def palindrome(x):
    reversed_number = x[::-1]
    k = 1
    if x != reversed_number:
        k = 0
    return k
  
number = input("Enter the string: ")
k = palindrome(number)
if k:
    print("nice! It is a palindrome number ")
else:
    print("Sorry! Try again")
Posted by: Guest on November-06-2021
0

python palindrome program

palindrome
Posted by: Guest on July-31-2021

Python Answers by Framework

Browse Popular Code Answers by Language