...

/

Solution Review: Print Pattern using Nested Loops

Solution Review: Print Pattern using Nested Loops

This review provides a detailed explanation of the solution to the "Print Pattern using Nested Loops" challenge.

We'll cover the following...

Solution

Let’s go over the solution to the challenge in Powershell and Python.

Python

Python 3.5
for i in range(0, 5): # Outer loop define the number of rows
for j in range(0, i+1): # Inner loop is used to define number of column in each row
# printing stars
print("*",end="")
print("\n") # Here the programs move to the next line

Explanation

  • Line: 1-2 Here, we have defined two loops; the outer loop is used to define the number of rows while the inner loop is used to
...