Search

# Python Programs to print pattern Number, Pyramid, Star, Diamond and Letter Pattern

Updated: Nov 7, 2020

Write a python program for given Numbers Pattern using a for loop

1

2 2

3 3 3

4 4 4 4

5 5 5 5 5

Program:

for num in range(6):

for i in range(num):

print(num, end=" ")

print(" ")

Write Python Program for Half pyramid pattern with numbers

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5

Program:

for i in range(1, 6):

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

print(column, end=' ')

print("")

Write Python Program for Half pyramid pattern with Star (*)

*

* *

* * *

* * * *

* * * * *

Program:

space = 1

for i in range(0, 5):

for j in range(0, space):

print("* ", end="")

space = space + 1

print()

#### Python Program for Downward Half-Pyramid Pattern with Star (*)

* * * * *

* * * *

* * *

* *

*

Program:

space = 5

for i in range(0, 5):

for j in range(0, space):

print("* ", end="")

space = space - 1

print()

Write Python Program to print following pattern?

* * * * * * * * * * * * * * * * * * * * * * * * *

Program

space = 1

for i in range(0, 5):

for j in range(0, space):

print("* ", end="")

space = space + 2

print()

Write Python Program to print following pattern

* * * * * * * * * * * * * * * * * * * * * * * * *

Program:

space = 9

for i in range(0, 5):

for j in range(0, space):

print("* ", end="")

space = space - 2

print()

Write Python Program to Print Right start Pattern with Star (*)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Program:

space = 1

for i in range(0, 5):

for j in range(0, space):

print("* ", end="")

space = space + 1

print()

for i in range(0, 6):

for j in range(0, space):

print("* ", end="")

space = space - 1

print()

Python Program to print Downward star Pattern

* * * * * *

* * * * *

* * * *

* * *

* *

*

Program:

rows = 5

k = 2 * rows - 2

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

for j in range(k, 0, -1):

print(end=" ")

k = k + 1

for j in range(0, i + 1):

print("*", end=" ")

print("")

Python Program to print following pattern

A BB CCC DDDD EEEEE

Program:

for i in range (65,70):

for j in range(65,i+1):

print(chr(i),end="")

print()

Python Program to print following pattern

A BC CDE DEFG EFGHI

Program:

for i in range (65,70):

for j in range(65,i+1):

print(chr(i),end="")

i=i+1

print()

## Recent Posts

See All

#### Python Program to Convert Decimal to Binary using recursive function

def decitobin(n): if n > 1: decitobin(n // 2) print(n % 2,end='') num = int(input("Enter any decimal number: ")) decitobin(num) Output: Enter any decimal number: 42 > 101010>

#### Python Program to find Sum of Series 1**3 + 2**3 + ................... + n**3

Program: n = int(input("Enter Positive Number : ")) sum = 0 sum= ((n*n)*(n+1)*(n+1))/4 print("The Sum of Series is",sum) Output: Enter Positive Number : 2 The Sum of Series is 9.0

#### Python Program to Find Sum of Series 1²+2²+3²+….+n²

The mathematical formula to find the sum of 1²+2²+3²+….+n² is n(n+1)(2n+1)/6 So to find the sum of series we use this formula. Program: n = int(input("Enter Positive Number : ")) sum = 0 sum= (n*(n+