String Formatting

  • + 0 comments

    def print_formatted(number): # your code goes here w = len(bin(number)[2:]) for i in range(1,number+1): print(f'{i:>{w}d} {i:>{w}o} {i:>{w}X} {i:>{w}b}')