how can I justify the output of this code?
N = int(input()) case = \'#\' print(case) for i in range(N): case += \'#\' print(case)
Seems like you might be looking for rjust:
https://docs.python.org/2/library/string.html#string.rjust
my_string = 'foo' print my_string.rjust(10) ' foo'