This function receives as a parameter an integer and should return a list representing the same value expressed in binary as a list of bits, where the first element in the l
def trans(x): if x == 0: return [0] bit = [] while x: bit.append(x % 2) x >>= 1 return bit[::-1]