With the help of python, I'm trying to reverse an integer and determine whether it is palindrome or not. Below, you can see my code where I defined the reverse and palindrome method. Is that correct?
def reverse(num):
s=len(num)
newnum=[None]*length
for i in num:
s=s-1
newnum[s]=i
return newnum
def palindrome(num):
a=str(num)
l=len(z)/2
if a[:1]==a[-1:][::-1]:
b=True
else:
b=False
I also have some trouble to type def main.