Write a function that reverses the bits in an integer.
For example, the number `417` is `110100001` in binary. Reversing the binary is `100001011` which is `267`.
You can assume that the number is not negative.
def reverse_bits(n):
    listbin = [bin(n)]
    listbin.sort(reverse = True)
    pleasework =  list(''.join(listbin))
    comeonguy = ''.join(pleasework)
    almostanswer = comeonguy[:1:-1]
    answer = int(almostanswer,2)
    return answer
    
    
    #bin(almost)
    pass
def reverse_bits(n):
    listbin = [bin(n)]
    listbin.sort(reverse = True)
    pleasework =  list(''.join(listbin))
    comeonguy = ''.join(pleasework)
    almostanswer = comeonguy[:1:-1]
    answer = int(almostanswer,2)
    return answer
    
    
    #bin(almost)
    pass