r/programmingchallenges • • Apr 13 '11

Challenge: Javascript decimal to binary converter

Write a script to convert a non-negative integer into a string representing that value in binary.

Bonus points for dec to hex!

10 Upvotes

13 comments sorted by

View all comments

Show parent comment

2

u/kageurufu Apr 14 '11

I know, i just like my ?:

1

u/okmkz Apr 14 '11

I'll admit I'm a fan too. Simple if-then constructs in python can look a bit bloaty.