Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions palindrome.py
Original file line number Diff line number Diff line change
@@ -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)