Skip to content
36 changes: 36 additions & 0 deletions Numeric Patterns/numericpattern107.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import math

def pattern(n):

for i in range(n):
count = 1
for j in range(n - i - 1):
print(' ', end='')
flag = 0
for k in range(2 * i + 1):
print(count, end='')
if(flag==1):
count = int(count / 2)
if(count!=0 and flag==0):
count = count * 2
if(count>=(i+1)):
flag=1

print()



print("Enter the number of rows: ")
n = int(input())
pattern(n)


# OUTPUT

# Enter the number of rows:
# 5
# 1
# 121
# 12421
# 1242100
# 124842100
35 changes: 35 additions & 0 deletions Numeric Patterns/numericpattern108.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import math

def pattern(n):

for i in range(n):
count= i+1
for j in range(n - i - 1):
print(' ', end='')
flag = 0
for k in range(2 * i + 1):
print(count, end='')
if(flag==1):
count = count+1
if(count!=0 and flag==0):
count = count - 1
if(count==1):
flag=1

print()



print("Enter the number of rows: ")
n = int(input())
pattern(n)

# OUTPUT

# Enter the number of rows:
# 5
# 1
# 212
# 32123
# 4321234
# 543212345
33 changes: 33 additions & 0 deletions Numeric Patterns/numericpattern109.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import math

def pattern(n):

for i in range(n):
count= n - i
for j in range(n - i - 1):
print(' ', end='')
flag = 0
for k in range(2 * i + 1):
print(count, end='')
if(flag==1):
count = count-1
if(count!=0 and flag==0):
count = count + 1
if(count==5):
flag=1

print()



print("Enter the number of rows: ")
n = int(input())
pattern(n)

# Enter the number of rows:
# 5
# 5
# 454
# 34543
# 2345432
# 123454321
35 changes: 35 additions & 0 deletions Numeric Patterns/numericpattern110.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import math

def pattern(n):

for i in range(n):
count= i+1
for j in range(n - i - 1):
print(' ', end='')
flag = 0
for k in range(2 * i + 1):
print(count, end='')
if(flag==1):
count = count-1
if(count!=0 and flag==0):
count = count + 1
if(count==(2*(i+1)-1)):
flag=1

print()



print("Enter the number of rows: ")
n = int(input())
pattern(n)

# OUTPUT

# Enter the number of rows:
# 5
# 1
# 232
# 34543
# 4567654
# 567898765
25 changes: 25 additions & 0 deletions Numeric Patterns/numericpattern111.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import math

def pattern(n):

for i in range(n):
count= i+1
for j in range(n - i - 1):
print(' ', end='')
flag = 0
for k in range(2 * i + 1):
print(count, end='')
if(flag==1):
count = count-1
if(count!=0 and flag==0):
count = count + 1
if(count==(2*(i+1)-1)):
flag=1

print()



print("Enter the number of rows: ")
n = int(input())
pattern(n)
35 changes: 35 additions & 0 deletions Numeric Patterns/numericpattern112.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import math

def pattern(n):

for i in range(n):
count= i+1
for j in range(n - i - 1):
print(' ', end='')
flag = 0
for k in range(2 * i + 1):
print(count*count, end=' ')
# if(flag==1):
# count = count-1
# if(count!=0 and flag==0):
# count = count + 1
# if(count==(2*(i+1)-1)):
# flag=1
count=count+1

print()



print("Enter the number of rows: ")
n = int(input())
pattern(n)

# OUTPUT

# Enter the number of rows:
# 5
# 1
# 4 9 16
# 9 16 25 36 49
# 16 25 36 49 64 81 100
15 changes: 15 additions & 0 deletions Numeric Patterns/numericpattern113.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
print("Enter the number of rows: ")
n = int(input())
count = n
for i in range(n):
print(" "*i + str(count)*(2*(n-i)-1))
count-=1

# OUTPUT
# Enter the number of rows:
# 5
# 555555555
# 4444444
# 33333
# 222
# 1
16 changes: 16 additions & 0 deletions Numeric Patterns/numericpattern114.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
print("Enter the number of rows: ")
n = int(input())
count = 2*n-1
for i in range(n):
print(" "*i + str(count)*(2*(n-i)-1))
count-=2


# OUTPUT

# print("Enter the number of rows: ")
# n = int(input())
# count = 2*n-1
# for i in range(n):
# print(" "*i + str(count)*(2*(n-i)-1))
# count-=2
18 changes: 18 additions & 0 deletions Numeric Patterns/numericpattern115.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
print("Enter the number of rows: ")
n = int(input())
for i in range(n):
count = 1
for j in range(0,2*(n-i)-1):
print(count,end="");
count+=1

print()

# OUTPUT
# Enter the number of rows:
# 5
# 123456789
# 1234567
# 12345
# 123
# 1
17 changes: 17 additions & 0 deletions Numeric Patterns/numericpattern129.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
print("Enter the number of rows: ")
n = int(input())
for i in range(n):
count = 1
for j in range(0,n):
print(count,end="");
if(j==n-i-1):
count=i+1
print()

# Enter the number of rows:
# 5
# 1 1 1 1 1
# 1 1 1 1 2
# 1 1 1 3 3
# 1 1 4 4 4
# 1 5 5 5 5