You are viewing a single comment's thread. Return to all comments →
def print_formatted(number): width = len(bin(number)[2:]) for i in range(1, number+1): print(f"{i:{width}d} {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 →