GUVI
Back

D-18 Can you please provide me the solution for this pattern program pattern9

20 Views
3 Comments

Ganesne1
Ganesne1 2 weeks ago
Ganesne1
@Ganesne1Profile is locked. Login

Hi Team,

 Can you please provide me with a solution for this pattern program

getting error due to white space, how can we remove space on pattern as we print based on rows and columns only. please advise 

code:

n = int(input())
s=[]
for row in range(n,0,-1):
    for col in range(0,row):
        s.append("*")
        s.append(" ")
    n-=1
    print(*s)
    s.clear()

image.png
Comments (3)
Please login to comment.
 
Habitate.io