Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pattern

rows = int(input("Enter rows:"))
cols = int(input("Enter Cols:"))

for i in range(0, rows):
    for j in range(0, cols):
        if i==0 or j==0 or i == rows-1 or j == cols-1:
            print("*", end="")
        else:
            print(" ", end="")
    print()

# This code is contributed by Shubhanshu Arya (Prepinsta Placement Cell Student) 
Comment

pattern

num = int(input("Enter the Number: "))

for i in range(1, num+1):
    for j in range(0, num):
        print(i, end="")
    print()

# This code is contributed by Shubhanshu Arya (Prepinsta Placement Cell Student) 
Comment

pattern

rows = int(input("Enter the Number of rows: "))
cols = int(input("Enter the Number of cols: "))

for i in range(0, rows):
    for j in range(0, cols):
        if i == 0 or j == 0 or j == cols-1 or i == rows - 1:
            print("3", end="")
        else:
            print(i, end="")
    print()

# This code is contributed by Shubhanshu Arya (Prepinsta Placement Cell Student) 
Comment

pattern

num = int(input("Enter the Number: "))
k = 1
for i in range(0, num):
    for j in range(0, i+1):
        print(k, end="")
        k = k+1
    print()

# This code is contributed by Shubhanshu Arya (Prepinsta Placement Cell Student) 
Comment

pattern


        python
        
            
        
     import re
text, pattern = input(), input()
m= list(re.finditer("(?=(%s))"%pattern,text))
if not m:
    print((-1,-1))
for i in m:
    print((i.start(1),i.end(1)-1))
Comment

patterns

    *
   #*#
  ##*##
 ###*###
 
 
 
 import java.util.Scanner;

public class Main {

	
	public static void main(String[] args) {
		
        
        Scanner sc= new Scanner(System.in);
        
        int n= sc.nextInt();
        
       for(int row=1;row<=n;row++)
       {
           for(int space=1;space<=n-row;rpw++)
           {
               System.out.print(" ");
           }
           
           for(int num=1;num<=row;num++)
           {
               System.out.print("*")
           }
       }

	}

}
Comment

PREVIOUS NEXT
Code Example
Python :: How to estimate memory of dataset using python command 
Python :: Free online converter of c ++ code to Python 
Python :: JET token authentication in Django UTC-1 
Python :: poython command options 
Python :: MyTestCase 
Python :: python x,y,z is d (20, 30, False) 
Python :: what hormone causes the feeling of love 
Python :: loess dataframe 
Python :: repetition of word in python 
Python :: pdf to excel python 
Python :: python code for diamond with gap between odd rows 
Python :: how to increase existing length with null python 
Python :: admin site 
Python :: List Get Sublist 
Python :: print current date and time in python 
Python :: python interface kenee 
Python :: python arithmetic operation with list 
Python :: port python script to jupyter notebook 
Python :: python use string to get object attributes 
Python :: make a pop up window in python 
Python :: Constructing a Class with __init__ function 
Python :: plot line2d on axis 
Python :: the grandest staircase of them all foobar solution 
Python :: pagerank formula 
Python :: how to see if something is in a class in python 
Python :: groupby Fiscal year 
Python :: first n lis tpython 
Python :: iris data pandas scatterplot 
Python :: matplotlib set dpi 300 
Python :: divide array into equal parts/slices python 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =