#Python 2, 44 bytes
for x in range(11):print bin(x)[2:].zfill(4)
This uses the zfill
function which works like rjust
except it always padds with 0
so you don't waste bytes on an argument.
#Python 2, 44 bytes
for x in range(11):print bin(x)[2:].zfill(4)
This uses the zfill
function which works like rjust
except it always padds with 0
so you don't waste bytes on an argument.