60 435
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #21141 in Python for vic

Question #21141
A palindrome is a word that reads the same both forward and backwards. Examples are ‘civic’ ‘racecar’ ‘eye’ and ‘madam’. Create a function called palindrome that takes a single word as a parameter and returns True if the word is a palindrome and False otherwise.
Expert's answer
def palindrome(num):
n=str(num)
whilelen(n)>1:
printn
ifn[0]!=n[-1]:
returnFalse
n=n[1:-1]
returnTrue

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions