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.
def isPalindrome(x):
arr = []
while x!= 0:
arr.append(x % 10)
x //= 10
return arr == arr[::-1]
Comments
Leave a comment