Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

converting int to binary python

def convert_to_binary(number:int):
    if number == None:
        return "Invalid input"
    elif type(number) == float:
        return "Float is not Handled"
    return format(number, "010b")

print(convert_to_binary(None))
print(convert_to_binary(100))
print(convert_to_binary(6.5))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #converting #int #binary #python
ADD COMMENT
Topic
Name
6+9 =