Text Alignment

  • + 0 comments
    c = 'H'
    w = " "
    for k in range(n):
        print((c*(2*(k+1)-1)).center(2*n))
    for k in range(n+1):
        print((c*n + w*n*(3) + c*n).center(6*n))
    for k in range((n+1) // 2):
        print((c*n*5).center(6*n))
    for k in range(n+1):
        print((c*n + w*n*(3) + c*n).center(6*n))
    for k in range(n):
        print((c*(2*(n-k)-1)).center(2*n).rjust(6*n))