Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

# -*- coding: utf-8 -*-

"""
Created on Fri Mar 18 13:11:13 2022

@author: Pratyush
"""
def Push (stk, data):
stk.append(data)
def Pop (stk):
if isempty (stk):
print ("Underflow")
return None
else:
return stk.pop()
def isempty (stk):
if len(stk)==0:
return True
else:
return False
st = input("enter a string to reverse :")
rev = []
for c in st:
Push (rev,c)
s=""
while True:
if isempty(rev):
break
s=s + Pop(rev)
if (s==st):
print ("given string is Palindrone")
else:
print ("given string is not a Palindrone")

You might also like