Download! Download Point responsive WP Theme for FREE!

Python pattern programming – Part 2

You can find variety of python patterns with programming in Python pattern programming – Part 2. While doing python programming there are few things to remember like spaces are very important and need accurate coding otherwise your code will not execute.

Python pattern programming – 01

Pattern1

 

 

 

 

 

 

def pattern(n):
    for i in range(1,n+1):
        for j in range(1,i+1):
            print(i,end="")
        print("\r")

n=5
pattern(n)

Python pattern programming – 02
pattern2

 

 

 

 

 

 

def pattern(n):
    for i in range(1,n+1):
        for j in range(1,i+1):
            print(j,end="")
        print("\r")

n=5
pattern(n)

 

Python pattern programming – 03
pattern3

 

 

 

 

 

 

def pattern(n):
    for i in range(1,n+1):
        for j in range(i,0,-1):
            print(j,end="")
        print("\r")

n=5
pattern(n)

Python pattern programming – 04
pattern4

 

 

 

 

 

 

def pattern(n):
    for i in range(n,0,-1):
        for j in range(n,i-1,-1):
            print(j,end="")
        print("\r")

n=5
pattern(n)

 

Python pattern programming – 05

pattern5

 

 

 

 

 

 

def pattern(n):
    for i in range(n,0,-1):
        for j in range(i,n+1):
            print(j,end="")
        print("\r")

n=5
pattern(n)



You can find variety of python patterns with programming in Python pattern programming – Part 2. While doing python programming there are few things to remember like spaces are very important and need accurate coding otherwise your code will not execute.

Python pattern programming – 06

pattern6

 

 

 

 

 

 

 

def pattern(n):
    for i in range(n,0,-1):
        for j in range(0,i):
            print(i,end="")
        print("\r")

n=5
pattern(n)

Python pattern programming – 07

pattern7

 

 

 

 

 

 

 

def pattern(n):
    for i in range(n,0,-1):
        for j in range(1,i+1):
            print(j,end="")
        print("\r")

n=5
pattern(n)

 

Python pattern programming – 08

pattern8

 

 

 

 

 

 

 

def pattern(n):
    for i in range(n,0,-1):
        for j in range(i,0,-1):
            print(j,end="")
        print("\r")

n=5
pattern(n)

 

Python pattern programming – 09

pattern9

 

 

 

 

 

 

 

def pattern(n):
    for i in range(1,n+1):
        for j in range(i,n+1):
            print(j,end="")
        print("\r")

n=5
pattern(n)

Python pattern programming – 10

pattern10

 

 

 

 

 

 

 

def pattern(n):
    for i in range(n,0,-1):
        for j in range(n,n-i,-1):
            print(j,end="")
        print("\r")

n=5
pattern(n)

Python pattern programming – 11

pattern11

 

 

 

 

 

 

 

def pattern(n):
    for i in range(0,n+1):
        for k in range(n,i,-1):
            print(" ",end="")
        for j in range(0,i):
            print(i,end="")
        print("\r")

n=5
pattern(n)

Python pattern programming – 12

pattern12

 

 

 

 

 

 

 

  def pattern(n):
    for i in range(0,n+1):
        for k in range(n,i,-1):
            print(" ",end="")
        for j in range(1,i+1):
            print(j,end="")
        print("\r")

n=5
pattern(n)

Python pattern programming – 13

pattern13

 

 

 

 

 

 

 

def pattern(n):
    for i in range(1,n+1):
        for k in range(n,i,-1):
            print(" ",end="")
        for j in range(n,n-i,-1):
            print(j,end="")
        print("\r")

n=5
pattern(n)

 

Python pattern programming – 14

pattern14

 

 

 

 

 

 

def pattern(n):
    for i in range(1,n+1):
        for k in range(n,i,-1):
            print(" ",end="")
        for j in range(n-i+1,n+1):
            print(j,end="")
        print("\r")

n=5
pattern(n)

Python pattern programming – 15

pattern15

 

 

 

 

 

 

def pattern(n):
    for i in range(0,n+1):
        for k in range(n,i,-1):
            print(" ",end="")
        for j in range(i,0,-1):
            print(j,end="")
        print("\r")

n=5
pattern(n)

 

 

Go to:http://tosal.in/python-pattern-programming-part-3/