From 7c2686f0ccb00f000d07c1f50aa4b038288ab8bb Mon Sep 17 00:00:00 2001 From: Aviral-Sharma-10 <100aviral100@gmail.com> Date: Sat, 13 Oct 2018 13:10:55 +0530 Subject: [PATCH] Issue #44 resolved --- introduction/Aviral/test.md | 2 -- programs/Palindrome_py3.py | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) delete mode 100644 introduction/Aviral/test.md create mode 100644 programs/Palindrome_py3.py diff --git a/introduction/Aviral/test.md b/introduction/Aviral/test.md deleted file mode 100644 index 09ff4bc..0000000 --- a/introduction/Aviral/test.md +++ /dev/null @@ -1,2 +0,0 @@ -this is a test file. -ignore. diff --git a/programs/Palindrome_py3.py b/programs/Palindrome_py3.py new file mode 100644 index 0000000..0ee1457 --- /dev/null +++ b/programs/Palindrome_py3.py @@ -0,0 +1,25 @@ +""" +Program to check whether entered string is Palindrome or not +using list manipulation. +""" + +print("Palindrome Test\n\n") + +str1=input("Enter string to be tested : ") +l1=list(str1) +palindrome=True + +if(len(l1)%2==0): + v = int(len(l1)/2) +else: + v = int((len(l1)-1)/2) + +for i in range(v): + if(l1[i].upper() != l1[-1-i].upper()): + palindrome=False + break + +if(palindrome==False): + print("\n",str1,"is not Palindrome.") +else: + print("\n",str1,"is Palindrome.")