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]
LATEST TUTORIALS
APPROVED BY CLIENTS