I'm trying to generate a simple triangle shape with numbers, where the output might look like this:
1
22
333
However, I can't get this to work with a nested String format, the best I can achieve is the following...
for i in range(1, size+1):
line = f'{i}' *i
print(f"{line:>{size}}")
Ideally, I'd like to have 'line' nested within the print method. Any suggestions?