You are viewing a single comment's thread. Return to all comments →
not better, just diferent, you can use list comprehension to get it short, and use rjust for formating the string.
this is my answer:
n = int(input()) [print("%s%s" % (" " * (n-f), "#" * f) ) for f in range(1,n+1)]
with rjust:
n = int(input()) [print(("#"*f).rjust(n) ) for f in range(1,n+1)]
Seems like cookies are disabled on this browser, please enable them to open this website
Staircase
You are viewing a single comment's thread. Return to all comments →
not better, just diferent, you can use list comprehension to get it short, and use rjust for formating the string.
this is my answer:
with rjust: