Simple python3 solution


#1

def reverse(self, A):
if A==0:
return 0
y = bin(A)[2:]
m = ‘00000000000000000000000000000000’
n = len(y)
m = m[n:]
y = y[::-1]
summ = y + m

    return int(summ, 2)

#2

If its in python do it in pythonic way:
return int(str(bin(A)[2:]).zfill(32)[::-1], 2)


#3

Could you please explain.