Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #integer #binary #python
ADD COMMENT
Topic
Name
2+6 =