Closed jeethub26230 closed 4 years ago
def pattern(n):
for i in range(1,n+1):
for j in range(1,i+1):
print("* ",end='')
print('')
val = int(input('Enter the number of rows: '))
pattern(val)
n = int(input("Enter the number: "))
def tree(n):
for m in range(0, n):
for n in range(0, m+1):
print("* ",end="")
print()
if (n<0):
print("Positive number please!")
else:
tree(n)
def pyramid(p):
for m in range(0, p):
for n in range(0, m+1):
print("* ",end="")
print("\r")
p = 5
pyramid(p)
for i in range(0,6):
for j in range(0,i):
print("*",end="")
print("\n")
# pattern formation
def pattern(number):
for i in range(0,number+1):
for j in range(0,i):
print("*",end="")
print("")
num=int(input())
pattern(num)
n = int(input("No. of rows to print"))
for i in range(0, n):
for j in range(0, i+1):
print("* ",end="")
print("\n")
rows = int(input("Enter number of rows ")) for i in range(0, rows): for j in range(0, i + 1): print("*", end=' ')
print("\r")
#This is Dinesh Behera
#Pattern Logic
def patrn(n):
for i in range(0,n+1):
for j in range(0,i):
print("* ",end="")
print("")
#Driver Code
n=int(input("Enter the pattern limit:"))
patrn(n)
n=int(input( " enter num of rows :") i=1 while i<=n: print("" i) i=i+1
def pattern():
num = int(input("Enter how many rows do you want to print the pattern upto"))
for i in range(1,num+1):
for j in range(1,i+1):
print("*",end=" ")
print()
option=input(print("Do you want to continue:(y/n)"))
if (option == 'y'):
pattern()
else:
print("Thank You")
print("Welcome")
pattern()
Create a Program which provides the below given pattern.