You are viewing a single comment's thread. Return to all comments →
Same solution using python3's latest f-strings
def print_formatted(n): width = (len(("{0:0b}".format(n)))) for i in range(1,n+1): print(f"{i:>{width}} {i:>{width}o} {i:>{width}X} {i:>{width}b}")
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 →
Same solution using python3's latest f-strings