Question #288042

Write a python function that will take any integer and return true or false if the number is palindrome using loop. Call this function in main body of the program and verify your output by printing the value returned.


Expert's answer

def isPalindrome(x):
    arr = []
    while x!= 0:
        arr.append(x % 10)
        x //= 10
    return arr == arr[::-1]

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!

LATEST TUTORIALS
APPROVED BY CLIENTS