Python program to check whether a string is a palindrome or not using recursive

0
33003
def is_palindrome(st):
    if len(st) < 1:
        return True
    else:
        if st[0] == st[-1]:
            return is_palindrome(st[1:-1])
        else:
            return False
str=str(input("Please enter string:"))
if(is_palindrome(str)==True):
    print("Given string is palindrome")
else:
    print("Given string is not palindrome")

    Output 1:
            Please enter string: did
            Given string is palindrome
    Output 2:
            Please enter string: done
            Given string is not palindrome

इन्हें भी देखें।

Python Programs के लिये यहाँ click करें।

 

 

 

 

Python program to check whether a string is a palindrome or not using recursive program to check whether a string is a palindrome or not using recursive write a python program to check whether a string is a palindrome or not using recursive write a program to check whether a string is a palindrome or not using recursive in python string is a palindrome or not using recursive in python check whether a string is a palindrome or not using recursive python program to check whether a string is a palindrome or not using recursion program to check whether a string is a palindrome or not using recursion in python write a python program to check whether a string is a palindrome or not using recursion program to check whether a string is a palindrome or not using recursion string is a palindrome or not using recursion string is a palindrome or not using recursion in python check whether a string is a palindrome or not using recursion in python

LEAVE A REPLY

Please enter your comment!
Please enter your name here