From c05779177d54e6b4b0687b7d2f117851d07c1bb9 Mon Sep 17 00:00:00 2001 From: Astha167 <147143057+Astha167@users.noreply.github.com> Date: Tue, 17 Oct 2023 20:03:54 +0530 Subject: [PATCH] Create palindrome string.py --- palindrome string.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 palindrome string.py diff --git a/palindrome string.py b/palindrome string.py new file mode 100644 index 0000000..4b0ea6f --- /dev/null +++ b/palindrome string.py @@ -0,0 +1,11 @@ +'''WAP to define a fn palin() that accept a string and check whether +it is palindrome''' +def palindrome(str): + P=str + Q=str[::-1] + if P==Q: + print('Palindrome string') + else: + print('Not a palindrome string') +str=input("Enter a string") +palindrome(str)