Question: Python simple triangle for loop: modify this code: n = int(input()) for i in range(0, n): X = 0 for j in range(0, n): X

Python simple triangle for loop:

modify this code:

n = int(input())

for i in range(0, n): X = 0 for j in range(0, n): X = (X*10)+1 print(X)

To print a descending right triangle, such as: (ex: n=6)

11111

1111

111

11

1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!