Answers for "how to convert int to binary 8 bits python"

0

convert integer to binary python

number = 5
print('The binary equivalent of 5 is:', bin(number))

# output - The binary equivalent of 5 is: 0b101
# "0b" indicates that this is a binary number
# 101 is the number (2**2 * 1) + (2**1 * 0) + (2**0 * 1) = 5
Posted by: Guest on December-22-2021

Code answers related to "how to convert int to binary 8 bits python"

Python Answers by Framework

Browse Popular Code Answers by Language