Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

star question in pyton

# Python 3.x code to demonstrate star pattern
 
# Function to demonstrate printing pattern
def pypart2(n):
     
    # number of spaces
    k = 2*n - 2
 
    # outer loop to handle number of rows
    for i in range(0, n):
     
        # inner loop to handle number spaces
        # values changing acc. to requirement
        for j in range(0, k):
            print(end=" ")
     
        # decrementing k after each loop
        k = k - 2
     
        # inner loop to handle number of columns
        # values changing acc. to outer loop
        for j in range(0, i+1):
         
            # printing stars
            print("* ", end="")
     
        # ending line after each row
        print("
")
 
# Driver Code
n = 5
pypart2(n)
Comment

star question in pyton

* 
      * * 
    * * * 
  * * * * 
* * * * *
Comment

star question in pyton

# Python 3.x code to demonstrate star pattern
 
# Function to demonstrate printing pattern
def pypart2(n):
     
    # number of spaces
    k = 2*n - 2
 
    # outer loop to handle number of rows
    for i in range(0, n):
     
        # inner loop to handle number spaces
        # values changing acc. to requirement
        for j in range(0, k):
            print(end=" ")
     
        # decrementing k after each loop
        k = k - 2
     
        # inner loop to handle number of columns
        # values changing acc. to outer loop
        for j in range(0, i+1):
         
            # printing stars
            print("* ", end="")
     
        # ending line after each row
        print("
")
 
# Driver Code
n = 5
pypart2(n)
Comment

star question in pyton

* 
      * * 
    * * * 
  * * * * 
* * * * *
Comment

PREVIOUS NEXT
Code Example
Python :: pygame download for python 3.10 
Python :: asyncio run in executor 
Python :: Define the learnable resizer utilities 
Python :: select all Textinput kivy on selection 
Python :: showing typle results with for loop in py 
Python :: how to find 6,6,77,8 in python 
Python :: index operator in python without input 
Python :: python recase 
Python :: how to select specific column with Dimensionality Reduction pyspark 
Python :: how to output varibles in python 
Python :: django compile database 
Python :: how to app object pyhthon 
Python :: howmanydays python 
Python :: counter vectriozer in python 
Python :: import 
Python :: dependency parser tags 
Python :: is console and terminal is same in spyder python(3.9) 
Python :: Python logging comma to dot 
Python :: iversao de matriz python 
Python :: python ask for real values until negative value diplay highest and lowest 
Python :: pdfkit supress output 
Python :: can only concatenate str (not "numpy.uint8") to str 
Python :: matplotlib plt.sapect 
Python :: how to press enter python keyboard 
Python :: map dataframe parallel 
Python :: start models 
Python :: python min function time complexity 
Python :: mongoengine ObjectIdField 
Python :: python last element of list using reverse() function 
Python :: django nested inlines 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =