1.

Write a program in python to print the pattern.​

Answer»

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:

*

* *

* * *

* * * *

* * * * *



Discussion

No Comment Found