YXH - 1 year ago 57

Python Question

Using Python, reverse an integer and determine if it is a palindrome. Here is my definition of reverse and palindrome. Do I have a correct logic?

`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 am having some trouble to write

`def main`