Skip to content

Commit a6a90ed

Browse files
author
Karan Goel
committed
Check palindrome done
1 parent 9c45b98 commit a6a90ed

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Text/palindrome.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""
2+
Check if Palindrome - Checks if the string entered
3+
by the user is a palindrome. That is that it reads
4+
the same forwards as backwards like "racecar"
5+
"""
6+
7+
string = raw_input('Enter a string: ').lower()
8+
9+
if string == string[::-1]:
10+
print '%s is a palindrome' % string
11+
else:
12+
print '%s is not a palindrome' % string

0 commit comments

Comments
 (0)