+ 1
How to print binary of numbers in python simple method
2 Answers
0
num=int(input())
print(bin(num))
+ 6
When converting the other way round, you might also use the int() method's second parameter to specify the base (10 by default):
int('1101', 2) == 13