Text Alignment

  • + 0 comments

    Somehow, i made the test 0 worked, but not the others, can anyone tell where is wrong? n = int(input()) for i in range(1,n+1): print(('H'*(2*i-1)).center(2*n-1,' ')) for i in range(0,n+1): print(('H'*n).center(2*n-1,' '),('H'*n).center(6*n,' ')) for i in range(0,n-2): print(('H'*5*n).rjust(5*n+2,' ')) for i in range(0,n+1): print(('H'*n).center(2*n-1,' '),('H'*n).center(6*n,' ')) for i in range(1,n+1): print(('H'*(2*n-(2*i-1))).rjust((5*n+5)-i,' '))