Program to print number pyramid using stars.

Code:

i = 7

s = 0

k=3

while (i>=0 and k>=0):

        a=(" "*s+"10"*k+"1"+" "*s)

        print(a)

        k=k-1

        i=i-2

        s=s+1

 

Output:


Comments

Popular posts from this blog

State use of pep and pip