CBSE Class 11 Informatics Practices Question 62 of 75

Conditional and Looping Constructs — Question 34

Back to all questions
34
Question

Question 18(a)

WAP to print the following pattern:

*
* *
* * *
* * * *
* * * * *
Solution
n = 5

for i in range(1, n + 1):
    for j in range(i):
        print("* ", end="")
    print()
Output
* 
* *
* * *
* * * *
* * * * *
Answer