Q:

Print the following pattern using Python programming

belongs to collection: Python Basic Exercises for Beginners

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)

Write a program to check if the given number is a ... >>
<< Write a program to find how many times substring ...