From 12a0365b23368f7c5fbedd0c598f9cefb02ded7c Mon Sep 17 00:00:00 2001 From: SHRIKANT ASHOK DANDGE <69064261+SHRISHRIKANT@users.noreply.github.com> Date: Thu, 1 Oct 2020 11:49:25 +0530 Subject: [PATCH 1/2] Create README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..69a1229 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# python-string-operations... +ganesh kavhar python projects.....https://ganeshmkavhar.000webhostapp.com/ + +STRING OPERATIONS:- + +1). COUNT THE FREQUENCY OF EACH WORD IN THE STRING. - charfreqcount.py +2). CONVERT STRING TO BINARY - txtbin.py +3). TO CHECK IF STRING IS PALINDROME - palindrome.py From 77a0d65c0361c7bcdde30d30b7ef7e18c906fd35 Mon Sep 17 00:00:00 2001 From: SHRIKANT ASHOK DANDGE <69064261+SHRISHRIKANT@users.noreply.github.com> Date: Thu, 1 Oct 2020 11:51:30 +0530 Subject: [PATCH 2/2] Create palindrome.py --- palindrome.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 palindrome.py diff --git a/palindrome.py b/palindrome.py new file mode 100644 index 0000000..c988c2b --- /dev/null +++ b/palindrome.py @@ -0,0 +1,32 @@ +def solution(list): + # creating an empty list + lst = [] + + # number of elemetns as input + n = int(input("Enter number of elements : ")) + + # iterating till the range + for i in range(0, n): + ele = int(input()) + + lst.append(ele) # adding the element + + out_list = lst[::-1] #reversing a list + m=0 + + # checking if palindrome + for i in range(0,n): + if lst[i]==out_list[i]: + m=m+1 + else: + print("FALSE") + break + if m==n: + print("TRUE") + + + + + +solution(list) +