Computer Science, asked by sreepradachintaginja, 6 months ago

python program to print the following pattern
2
333
22222
3333333
222222222

Answers

Answered by islamjaha949
0

Explanation:

Patterns can be printed in python using simple for loops. First outer loop is used to handle number of rows and Inner nested loop is used to handle the number of columns. Manipulating the print statements, different number patterns, alphabet patterns or star patterns can be printed.

Some of the Patterns are shown in this article.

Simple pyramid pattern

# Python 3.x code to demonstrate star pattern

# Function to demonstrate printing pattern

def pypart(n):

# outer loop to handle number of rows

# n in this case

for i in range(0, n):

# inner loop to handle number of columns

# values changing acc. to outer loop

for j in range(0, i+1):

# printing stars

print("* ",end="")

Similar questions