the-honk/school/gcse/year 10/pallindromes/Pallindrome Checker with Loop.py

14 lines
309 B
Python
Raw Normal View History

2024-10-09 17:02:27 +00:00
word = input('Please enter a word!')
def isPallindrome(x):
reverse = ''
i = len(x)
while i > 0:
reverse += x[i - 1]
i = i - 1
return x == reverse
if isPallindrome(word):
print('{0} is a pallindrome!'.format(word))
else:
print('{0} is not a pallindrome!'.format(word))