Am supposed to capture user input as an integer, convert to a binary, reverse the binary equivalent and convert it to an integer.Am getting the right output but someone says the solution is wrong. Where is the problem?
x = 0
while True:
try:
x = int(raw_input('input a decimal number \t'))
if x in xrange(1,1000000001):
y = bin(x)
rev = y[2:]
print("the reverse binary soln for the above is %d") %(int('0b'+rev[::-1],2))
break
except ValueError:
print("Please input an integer, that's not an integer")
continue