String Formatting

  • + 0 comments

    def print_formatted(number):

    # your code goes here
    
    w=len(f"{n:b}")
    
    for i in range (1, n+1): 
    
        print(f"{i:>{w}} {i:>{w}o} {i:>{w}X} {i:>{w}b}")