Z 445 Pyramid of Asterisks HackerRank Answer

 *

**
***
**** until N lines.

Input Format

Only one integer N.

Constraints

1 <= N <= 10

Output Format

Output a pyramid of asterisks with height N.

Sample Input 0

5

Sample Output 0

*
**
***
****
*****
Source Code
rows = int(input())
for i in range(0, rows):
    for j in range(0,i + 1):
        print("*", end='')
    print("\r")

Comments