Below is my code:
def check_palindrome(num):
my_str = str(num)
my_list1 = list(my_str)
my_list2 = list(my_str)
my_list2.reverse()
if my_list1 == my_list2:
return "It's palindrome"
else:
return "Not a palindrome"
print(check_palindrome(232))
print(check_palindrome(235))
If I execute the code in a terminal it works, but I'm not sure if is it short and nead code or not?