Print Rhombus Star Pattern

15 comments on “Print Rhombus Star Pattern”


  • dronamraju

    rows=int(input())
    tot=2*rows-1 #Bottom line consists of 2*rows-1 stars
    j=1
    for i in range(rows):
    s=” “*(tot//2)+’*’*j
    print(s)
    tot-=2
    j+=2


  • Pravallika

    n = int(input()) #number of rows
    m = n #for white spaces
    for i in range(n+1):
    for k in range(m):
    print(” “,end=””)
    m -= 1
    for j in range(i*2-1):
    print(“*”,end=””)
    print()


  • Krishan

    Python3 Code:
    def pattern(r):
    ”’ Rhombus Star Pattern Difficulty ”’
    for i in range(r):
    print(i*’ ‘ + r*’*’)

    if __name__ == “__main__”:

    rows = int(input(‘Enter number of rows: ‘))
    pattern(rows)


  • shreyank

    def rhombusStarpattern(rows):

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

    for j in range (1,rows + i + 1):
    print (end=” “)

    for j in range (1,rows + 1):
    print (“*”,end=””)

    # Move to the next line/row
    print()

    # utility program to print all patterns
    def printPattern(rows):
    rhombusStarpattern(rows)

    # driver program

    if __name__ == “__main__”:

    rows = 4
    printPattern (rows)


  • Karthick Ramesh

    n=int(input())
    for i in range(0,n):
    for j in range(0,i):
    print(” “,end=”)
    for j in range(n):
    print(“*”,end=”)
    print()


  • sampath pendurthi

    n=int(input(“enter a number:”)
    for i in range(n):
    for j in range(n):
    print(“*”,end=””)
    print(end=”\n”+” “*(i+1))