Answers for "snoop - code execution tracker"

0

snoop - code execution tracker

import snoop

@snoop
def number_to_bits(number):
    if number:
        bits = []
        while number:
            number, remainder = divmod(number, 2)
            bits.insert(0, remainder)
        return bits
    else:
        return [0]

number_to_bits(6)
Posted by: Guest on April-29-2021

Python Answers by Framework

Browse Popular Code Answers by Language