Rhombus Pattern Program In Python Most Asked in Interview
And below Python concepts are used to print that patterns
For Loop
While Loop
if..else
1). Program to print right Inclined Solid Rhombus using star(*) in Python
n = int(input("Enter the number of rows for Rhombus:"))
for i in range(0,n):
for j in range(1,n-i):
print(" ",end='')
for k in range(0,n):
print("*",end='')
print()
Output
2). Program to print left inclined Solid Rhombus using star(*) in Python
n = int(input("Enter the number of rows for Rhombus:"))
for i in range(n,0,-1):
for j in range(0,n-i):
print(" ",end='')
for k in range(0,n):
print("*",end='')
print()
Output
Keep reading
Related Questions
More from Interview Preparation — pick the next question to continue your revision.