top of page

Write a Program to make Star Design Pattern in Python.

Patters in python are printed using for loops. Different numeric, alphabetic or symbolic patterns can be formed using these loops by manipulating values or print statements according to the question to find the right solution.


Below is the program to print the star pattern - upward and downward pyramid at the same time to make a new design pattern.


code:

n = int(input('Enter the number of rows:'))
i = 0
while i <= n - 1:
    j = 0
    while j < i:
        # display space
        print('', end= ' ')
        j += 1
    k = i
    while k <= n - 1:
        print('*', end= ' ')
        k += 1
    print()
    i += 1

i = n - 1
while i >= 0:
    j = 0
    while j < i:
        print('', end= ' ')
        j += 1
    k = i
    while k <=  n - 1:
        print('*', end= ' ')
        k += 1
    print('')
    i -= 1

Output:

ree



The Tech Platform

4 Comments


Aryan
Aryan
Aug 14

For those seeking a different kind of thrill, the casino and betting platform known as Jalwa Game provides a wide range of games, including slots and sports betting.


Like

Aryan
Aryan
Aug 14

The ease of a quick Jalwa Game Login allows users to jump right into the action, which is a key factor in keeping players engaged.


Like

Aryan
Aryan
Aug 14

For those seeking more excitement, the betting and casino platform known as Jalwa Game offers a thrilling way to test your luck and potentially win real money.


Like

Aryan
Aryan
Aug 14

Users appreciate a secure Jalwa Game login system that protects their personal data and financial information, building trust in the platform.


Like
bottom of page