Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

generate binary number in python

num = int(input("Enter a number: ")) #generates a number
print(int(bin(num[2:]))) #converts the number to binary and prints it
#the [2:] is there because there is a b showing it is bnary but we dont want that in a binary number
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #generate #binary #number #python
ADD COMMENT
Topic
Name
9+2 =