+ 1

How to convert decimal to binary in python?

a function required using while loop!

14th May 2017, 7:06 PM
Hassan Baloch
Hassan Baloch - avatar
1 Answer
+ 9
Why complicate? I would go with: def d2b(x): return int(bin(x)[2:]) >>> print(d2b(8)) 1000
14th May 2017, 7:58 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar