Write a Python program to print the following pattern.
Attachments:
Answers
Answered by
2
Required python program:
Using nested loop :
row = 5
for i in range (0,row):
for j in range (0,i+1):
print("*",end ="")
print ()
Using single loop :
row = 5
for i in range (row+1):
print( "*" * i)
Output :
*
* *
* * *
* * * *
* * * * *
* * * * * *
Similar questions