Skip to content

Commit 4f0635d

Browse files
author
codehouseindia
authored
Merge pull request codehouseindia#23 from Graey/patch-6
Program to check if a string is palindrome or not
2 parents 9af130a + 47ae536 commit 4f0635d

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

palindromestring.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# https://www.facebook.com/graeyaki/posts/3604553256276181
2+
# Subscribed by Pranav Kumar Mishra
3+
4+
5+
my_str = 'aIbohPhoBiA'
6+
7+
my_str = my_str.casefold()
8+
9+
rev_str = reversed(my_str)
10+
11+
if list(my_str) == list(rev_str):
12+
print("The string is a palindrome.")
13+
else:
14+
print("The string is not a palindrome.")

0 commit comments

Comments
 (0)