Q:

Simple pattern printing programs in Python | Pattern 2

belongs to collection: Python basic programs

0

Now if we want to print numbers or alphabets in this pattern then we need to replace the * with the desired number you want to replace. Like if we want pattern like,

1
1  1
1  1  1
1  1  1  1
1  1  1  1  1

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#row operation
for row in range(0,5):

# column operation

    for column in range(0,row+1):
        print("1 ",end="")

    # ending line
    print('\r')

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Python basic programs

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Simple pattern printing programs in Python | Patte... >>
<< Python program to check the given year is a leap y...