I need to use nested loops to generate a triangle. The output needs to look like this.
How many lines? 7
0000000
000000
00000
0000
000
00
0
Currently I have attempted to use this, but I am unsure on how to get the 0's to face the right way.
def main():
start = int(input("How many lines?"))
end = 0
increment = -1
for rows in range(start,end,increment):
for colums in range(rows):
print("0", end= "")
print()
main()
And the output of this is.
How many lines?7
0000000
000000
00000
0000
000
00
0
I am just unsure how to fix it, any help is appreciated.