Q:

Print the following pattern using Python programming

0

Print the following pattern

1 
2 2 
3 3 3 
4 4 4 4 
5 5 5 5 5

All Answers

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

Solution:

for num in range(10):
    for i in range(num):
        print (num, end=" ") #print number
    # new line after each row to display pattern correctly
    print("\n")

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

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now