Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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("*")
           }
       }

	}

}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #patterns
ADD COMMENT
Topic
Name
5+2 =