Program to print half-pyramid using stars.

Code:

n = 4

for i in range(0, n):

    for j in range(0, i+1):

        print("*",end="")

    print("\r")

 

Output:


Comments

Popular posts from this blog

State use of pep and pip