Nested Loop to Generate Triangle
I need the triangle to be in reverse. The assignment requires a nested loop to generate a triangle with the user input of how many lines. Currently, I get answers such as: OOO OO O When I actually need it to be like this: OOO OO O I just need to get it flipped-over on the other side. Here is the code I have written, thank you. base_size = int(input("How many lines? ")) columns = base_size for row in range (base_size) : for columns in range (columns) : print('O', end='') print() -- https://mail.python.org/mailman/listinfo/python-list
Nested
d -- https://mail.python.org/mailman/listinfo/python-list
Re: Nested Loop to Generate Triangle
On Thursday, May 25, 2017 at 12:28:45 PM UTC-4, Victor Demelo wrote: > I need the triangle to be in reverse. The assignment requires a nested loop > to generate a triangle with the user input of how many lines. > > Currently, I get answers such as: > > OOO > OO > O > > When I actually need it to be like this: > > OOO >OO > O > > > I just need to get it flipped-over on the other side. > > Here is the code I have written, thank you. > > > > base_size = int(input("How many lines? ")) > columns = base_size > > for row in range (base_size) : >for columns in range (columns) : >print('O', end='') >print() -- https://mail.python.org/mailman/listinfo/python-list
Re: Nested Loop to Generate Triangle
On Thursday, May 25, 2017 at 12:28:45 PM UTC-4, Victor Demelo wrote: > I need the triangle to be in reverse. The assignment requires a nested loop > to generate a triangle with the user input of how many lines. > > Currently, I get answers such as: > > OOO > OO > O > > When I actually need it to be like this: > > OOO >OO > O > > > I just need to get it flipped-over on the other side. > > Here is the code I have written, thank you. > > > > base_size = int(input("How many lines? ")) > columns = base_size > > for row in range (base_size) : >for columns in range (columns) : >print('O', end='') >print() -- https://mail.python.org/mailman/listinfo/python-list
Nested Loop Triangle
I need the triangle to be in reverse. The assignment requires a nested loop to generate a triangle with the user input of how many lines. Currently, I get answers such as: (A) OOO OO O When I actually need it to be like this: (B) OOO OO O I need the display (A) to just be in revered, so I need it starting from the right side and go left, and not the left side going right with the '0' stacking on top one another. #Code base_size = int(input("How many lines? ")) columns = base_size for row in range (base_size) : for columns in range (columns) : print('O', end='') print() -- https://mail.python.org/mailman/listinfo/python-list