Computer Science, asked by simmii1431, 1 year ago

Heyyy plzz do this....

write a programme in Python to print this shapes.......

plzzz help me out :(

Attachments:

rajchauhan20: Hello

Answers

Answered by NeverMind11
4
# Python program to 

# print Diamond shape

  

# Function to print

# Diamond shape

def Diamond(rows):

    n = 0

    for i in range(1, rows + 1):

        # loop to print spaces

        for j in range (1, (rows - i) + 1):

            print(end = " ")

          

        # loop to print star

        while n != (2 * i - 1):

            print("*", end = "")

            n = n + 1

        n = 0

          

        # line break

        print() 

  

    k = 1

    n = 1

    for i in range(1, rows):

        # loop to print spaces

        for j in range (1, k + 1):

            print(end = " ")

        k = k + 1

          

        # loop to print star

        while n <= (2 * (rows - i) - 1):

            print("*", end = "")

            n = n + 1

        n = 1

        print()

  

# Driver Code

# number of rows input

rows = 5

Diamond(rows)

Answered by maroofahmad88
5
Here is your answer in attachment
Attachments:

simmii1431: So tc and byy
simmii1431: Hyy what r u doing here ?
simmii1431: go na.....
simmii1431: same to u
Similar questions