-
Notifications
You must be signed in to change notification settings - Fork 0
/
star.py
61 lines (54 loc) · 1.59 KB
/
star.py
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
n = int(input("Enter the number "))
for i in range(0,n):
for j in range(0 , (2*n)-i):
print(" ",end="")
print("*" , end = "")
for j in range(0 , (2*i)-1):
print(" ",end="")
if(not(i == 0)):
print("*")
else:
print("")
if(i == (n-1)):
for x in range(0,n):
if(x==0):
for i in range(0 , n):
print("*" , end= "")
for i in range (0 , (2 * n)+1):
print(" ",end="")
for i in range(0 , n):
print("*" , end= "")
print("")
for j in range(-1 , x):
print(" ", end = "")
print("*" , end=" " )
for j in range(0 , (3*n)-(2*x)):
print(" ", end="")
print("*")
for i in range (0 ,n ):
for j in range(0 , n-i):
print(" ",end="")
print("*" , end = "")
for j in range (0 , (2*n)+2*i):
print(" ",end="")
print("*")
if(i == (n-1)):
for m in range(0,n):
print("*",end="")
for m in range(0,2*n+(int(n/2))):
print(" " , end="")
for m in range(0,n):
print("*" , end="")
if(i == (n-1)):
print("")
for x in range(0,n):
for k in range(0,(n+x)):
print(" ",end="")
print("*" , end="")
for k in range(0,(2*n)-(2*x)):
print(" ", end="")
print("*")
if(x==(n-1)):
for i in range (0 ,2*n):
print(" ",end="")
print("*")