Python Program to Print X Star Pattern

Write a Python Program to Print X Pattern using a for loop. # Python Program to Print X Star Pattern rows = int(input(“Enter X Pattern Odd Rows = “)) print(“X Star Pattern”) for i in range(0, rows): for j in range(0, rows): if(i == j or j == rows – 1 – i): print(‘*’, end … Read more

Python Program to Print Plus Star Pattern

Write a Python Program to Print Plus Star Pattern using a for loop. In this Python example, both the for loop will traverse from 1 to 2 * rows. The if statement checks whether i or j equals rows and, if valid, print stars. # Python Program to Print Plus Star Pattern rows = int(input(“Enter … Read more

Python Program to find Rhombus Perimeter

Write a Python Program to find the Perimeter of a Rhombus with an example. This Python example allows the Rhombus side and calculates the Rhombus perimeter. # Python Program to find Rhombus Perimeter rhombusSide = float(input(“Enter the Rhombus Side = “)) rhombusPerimeter = 4 * rhombusSide print(“The Perimeter of a Rhombus = %.3f” %rhombusPerimeter) In … Read more

Python Program to find Rhombus Area

Write a Python Program to Find the Area of a Rhombus with an example. This Python example allows Rhombus first and second diagonal and calculates Rhombus area. # Python Program to find Rhombus Area rhombusD1 = float(input(“Enter Rhombus First Diagonal = “)) rhombusD2 = float(input(“Enter Rhombus Second Diagonal = “)) rhombusArea = (rhombusD1 * rhombusD2)/2 … Read more

Python Program to Print Hollow Right Triangle Star Pattern

Write a Python Program to Print Hollow Right Triangle Star Pattern using for loop. The nested for loops iterate from 1 to rows and i and if condition check for the outline values and print those stars. # Python Program to Print Hollow Right Triangle Star Pattern rows = int(input(“Enter Hollow Right Triangle Pattern Rows … Read more

Python Program to Print Hollow Square Star With Diagonals

Write a Python Program to Print Hollow Square Star With Diagonals using a for loop. The if condition checks whether the position is Diagonal or the outer line, and if true, print stars; otherwise, print a space. # Python Program to Print Hollow Square Star With Diagonals Pattern rows = int(input(“Enter Hollow Square Star With … Read more

Python Program to Print Inverted Pyramid Star Pattern

Write a Python Program to Print Inverted Pyramid Star Pattern using a for loop. rows = int(input(“Enter Inverted Pyramid Pattern Rows = “)) print(“Inverted Pyramid Star Pattern”) for i in range(rows, 0, -1): for j in range(0, rows – i): print(end = ‘ ‘) for k in range(0, i): print(‘*’, end = ‘ ‘) print() … Read more

Python Program to Print Mirrored Half Diamond Star Pattern

Write a Python Program to Print Mirrored Half Diamond Star Pattern using for loop. # Python Program to Print Mirrored Half Diamond Star Pattern rows = int(input(“Enter Mirrored Half Diamond Pattern Rows = “)) print(“Mirrored Half Diamond Star Pattern”) for i in range(rows): for j in range(0, rows – i): print(‘ ‘, end = ”) … Read more

Python Program to Print Hollow Rhombus Star Pattern

Write a Python Program to Print Hollow Rhombus Star Pattern using for loop. The nested for loop and if else statements help to print the hollow rhombus pattern. # Python Program to Print Hollow Rhombus Star Pattern hrows = int(input(“Enter Howllow Rhombus Star Pattern rows = “)) print(“Hollow Rhombus Star Pattern”) for i in range(hrows, … Read more

Python Program to Print Hollow Mirrored Rhombus Star Pattern

Write a Python Program to Print Hollow Mirrored Rhombus Star Pattern using for loop. This Python example uses nested for loops and if-else to return hollow mirrored rhombus pattern. # Python Program to Print Hollow Mirrored Rhombus Star Pattern rows = int(input(“Enter Hollow Mirrored Rhombus Pattern Rows = “)) print(“Hollow Mirrored Rhombus Star Pattern”) for … Read more