Skip to content

Commit 3def30b

Browse files
committed
Added palindrome implementation
1 parent 990e0cb commit 3def30b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pygorithm/string/palindrome.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#Author: OMKAR PATHAK
2+
# Created On: 17th August 2017
3+
4+
def is_palindrome(string):
5+
'''This function checks the string for palindrome'''
6+
revString = string[::-1]
7+
if string == revString:
8+
return True
9+
else:
10+
return False
11+
12+
def get_code():
13+
""" returns the code for the current class """
14+
import inspect
15+
return inspect.getsource(palindrome)

0 commit comments

Comments
 (0)