-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathP29.py
More file actions
27 lines (22 loc) · 737 Bytes
/
P29.py
File metadata and controls
27 lines (22 loc) · 737 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
num = int(input("Enter the number of rows : "))
n = int(input("Enter 0 or 1 : "))
b = bool(n)
if b==True:
for i in range(num):
for j in range(0,i+1):
print("*",end="")
print("")
elif b==False:
for i in range(num,0,-1):
for j in range(i):
print("*",end="")
print("")
''' OUTPUT
Enter the number of rows : 5
Enter 0 or 1 : 1
*
**
***
****
*****
'''