-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtriangle.py
More file actions
38 lines (31 loc) · 764 Bytes
/
triangle.py
File metadata and controls
38 lines (31 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
'''
Author:IRENE
Date:22-11-24
row=int(input("Enter number of rows"))
'''
for i in range (row):
for j in range(i+1):
print("*",end="")
print("")
row=int(input("Enter the number of rows"))
print("decreasing triangle")
for i in range (row):
for j in range(row-i):
print("*",end="")
print(" ")
print("hill pattern")
row=int(input("Enter the number of rows"))
for i in range(1, row +1):
for j in range(row - i):
print(" ",end="")
for k in range (2*i-1):
print("*", end="")
print()
row=int(input("Enter the number of rows"))
print("reverse hill pattern")
for i in range(row,0,-1):
for j in range (row - i):
print(" ",end="")
for k in range (i*2-1):
print("*",end="")
print()