You are viewing a single comment's thread. Return to all comments →
DRY Python 3 version:
def print_formatted(number): width = len('{:b}'.format(number)) for num in range(1, n+1): print(*('{i:{w}{b}}'.format(i=num, w=width, b=base) for base in 'doXb'), sep=' ', end='\n')
Seems like cookies are disabled on this browser, please enable them to open this website
String Formatting
You are viewing a single comment's thread. Return to all comments →
DRY Python 3 version: