Skip to content
Open
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
16 changes: 16 additions & 0 deletions samplecheckpalindrome.py
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
def checkPalindrome(word):
'''
This program checks if a word or sentence is a palindrome.

A palindrome is a word or statement that reads the same in reverse
:param word: This parameter is a string of words or sentence to be checked.
:return: The function doesn't have a return value.
'''
if word == word[::-1]:
print('Word is a palindrome')
else:
print('Word is not a palindrome')


checkPalindrome('sms')
checkPalindrome('ayak')