Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am learning Python 3.6.5 and trying to solve this homework problem in myprogra

ID: 3915544 • Letter: I

Question

I am learning Python 3.6.5 and trying to solve this homework problem in myprogramminglab. The question is. For this problem, display a right triangle with the vertical leg on the left and the slope leg going from the top left going right. The right angle should be on the bottom left. You need only draw the two legs using a single # per leg per line. You can achieve this using a nested loop so that the inner loop runs as many times as the current count of the outer loop. See programs 4-18 to 4-20 in your textbook for examples.

My solution:

print('Enter number of lines for pattern:')

number = int(input())

for rows in range(number):

print('#', end='')

for columns in range(rows):

print(' ', end='')

print('#')

The only feedback I get from myprogramminglab is " Attention: the difference between your stdout and the expected stdout is just a question of spacing." I even asked my professor and he said my answer is correct. I am just not answering in the way that the programminglab likes for me to aka make it more simple. How can I make this more simple or what am I doing wrong that causes 'question of spacing'?

Below is what I am getting

Explanation / Answer

number = int(input('Enter number of lines for pattern:')) for rows in range(number): print('#', end='') for columns in range(rows): print(' ', end='') print('#')