write a program in python to print the pattern.
Attachments:
Answers
Answered by
41
Required program:
Method 1:
rows = 5
for i in range(0, rows):
for j in range(0, i + 1):
print("*", end=' ')
print("\r")
Method 2:
rows = 5
for j in range(1, rows+1):
print("* " * j)
Output:
*
* *
* * *
* * * *
* * * * *
Similar questions