Python Program to Print Pascal Triangle

Write a Python program to print a Pascal triangle number pattern using for loop. To print the Pascal triangle, we must use the nested for loop to iterate multi-level numbers and find the factorial of each number in an iteration. In this example, we use the built-in math factorial function. Please refer to For loop … Read more

Python Program to Print Left Pascals Number Triangle

Write a Python program to print left pascals number triangle using for loop. rows = int(input(“Enter Left Pascals Number Triangle Pattern Rows = “)) print(“====Left Pascals Number Triangle Pattern====”) for i in range(1, rows + 1): for j in range(i, rows): print(end = ‘ ‘) for k in range(1, i + 1): print(k, end = … Read more

Python Program to Print K Shape Number Pattern

Write a Python program to print K shape number pattern using for loop. rows = int(input(“Enter K Shape Number Pattern Rows = “)) print(“====K Shape Number Pattern====”) for i in range(rows, 0, -1): for j in range(1, i + 1): print(j, end = ‘ ‘) print() for i in range(2, rows + 1): for j … Read more

Python Program to Print Inverted Right Triangle Numbers in Reverse

Write a Python program to print inverted right triangle numbers in reverse order using for loop. rows = int(input(“Inverted Right Triangle Numbers in Reverse pattern Rows = “)) print(“==Inverted Right Triangle of Numbers in Reverse Order Pattern==”) for i in range(1, rows + 1): for j in range(rows, i – 1, -1): print(j, end = … Read more

Python Program to Print Inverted Right Triangle of Decreasing Order Numbers

Write a Python program to print inverted right triangle of decreasing order numbers pattern using for loop. rows = int(input(“Inverted Right Triangle Numbers in Decreasing Ord Rows = “)) print(“==Inverted Right Triangle of Numbers in Decreasing Order Pattern==”) for i in range(rows, 0, -1): for j in range(i, 0, -1): print(j, end = ‘ ‘) … Read more

Python Program to Print Inverted Right Triangle of Consecutive Numbers

Write a Python program to print inverted right triangle of consecutive numbers in each row using for loop. rows = int(input(“Inverted Right Triangle Consecutive Row Numbers Rows = “)) print(“==Inverted Right Triangle Consecutive Rows Numbers Pattern==”) for i in range(rows, 0, -1): for j in range(1, i + 1): print(j, end = ‘ ‘) print() … Read more

Python program to Print Sandglass Number Pattern

Write a Python program to print sandglass number pattern using for loop.  rows = int(input(“Enter Sandglass Number Pattern Rows = “)) print(“====Sandglass Number Pattern====”) for i in range(1, rows + 1): for j in range(1, i): print(end = ‘ ‘) for k in range(i, rows + 1): print(k, end = ‘ ‘) print() for i … Read more

Python Program to Print a Simple Number Pattern

Write a Python program to print a simple number pattern using for loop. rows = int(input(“Enter Simple Numeber Pattern Rows = “)) print(“====Printing Simple Number Pattern====”) for i in range(1, rows + 1): for j in range(1, i + 1): print(j, end = ‘ ‘) print() This example Python program displays the numbers in the … Read more

Python Program to Print Diamond Number Pattern

Write a Python program to print diamond number pattern using for loop. rows = int(input(“Enter Diamond Number Pattern Rows = “)) print(“====Diamond Number Pattern====”) for i in range(1, rows + 1): for j in range(1, rows – i + 1): print(end = ‘ ‘) for k in range(1, (2 * i)): print(k, end = ”) … Read more

Python Program to Print Consecutive Rows Numbers in Right Triangle

Write a Python program to print consecutive rows numbers in right triangle pattern using for loop. rows = int(input(“Enter Consecutive Numbers in Right Triangle Pattern Rows = “)) print(“====Consecutive Row Numbers Right Triangle Pattern====”) for i in range(1, rows + 1): val = i for j in range(1, i + 1): print(val, end = ‘ … Read more