diff --git a/Numeric Patterns/numericpattern107.py b/Numeric Patterns/numericpattern107.py new file mode 100644 index 00000000..703a2dd0 --- /dev/null +++ b/Numeric Patterns/numericpattern107.py @@ -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 diff --git a/Numeric Patterns/numericpattern108.py b/Numeric Patterns/numericpattern108.py new file mode 100644 index 00000000..2510e520 --- /dev/null +++ b/Numeric Patterns/numericpattern108.py @@ -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 diff --git a/Numeric Patterns/numericpattern109.py b/Numeric Patterns/numericpattern109.py new file mode 100644 index 00000000..90cc5100 --- /dev/null +++ b/Numeric Patterns/numericpattern109.py @@ -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 diff --git a/Numeric Patterns/numericpattern110.py b/Numeric Patterns/numericpattern110.py new file mode 100644 index 00000000..35b1770b --- /dev/null +++ b/Numeric Patterns/numericpattern110.py @@ -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 diff --git a/Numeric Patterns/numericpattern111.py b/Numeric Patterns/numericpattern111.py new file mode 100644 index 00000000..ee986554 --- /dev/null +++ b/Numeric Patterns/numericpattern111.py @@ -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) diff --git a/Numeric Patterns/numericpattern112.py b/Numeric Patterns/numericpattern112.py new file mode 100644 index 00000000..36f7a096 --- /dev/null +++ b/Numeric Patterns/numericpattern112.py @@ -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 diff --git a/Numeric Patterns/numericpattern113.py b/Numeric Patterns/numericpattern113.py new file mode 100644 index 00000000..6603addf --- /dev/null +++ b/Numeric Patterns/numericpattern113.py @@ -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 diff --git a/Numeric Patterns/numericpattern114.py b/Numeric Patterns/numericpattern114.py new file mode 100644 index 00000000..84139f89 --- /dev/null +++ b/Numeric Patterns/numericpattern114.py @@ -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 diff --git a/Numeric Patterns/numericpattern115.py b/Numeric Patterns/numericpattern115.py new file mode 100644 index 00000000..f0b736ce --- /dev/null +++ b/Numeric Patterns/numericpattern115.py @@ -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 diff --git a/Numeric Patterns/numericpattern129.py b/Numeric Patterns/numericpattern129.py new file mode 100644 index 00000000..6e60cbac --- /dev/null +++ b/Numeric Patterns/numericpattern129.py @@ -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