-
Notifications
You must be signed in to change notification settings - Fork 1
/
Pattern_1.py
52 lines (46 loc) · 1.54 KB
/
Pattern_1.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
"""
*
* * *
* * * * *
* * * * * * *
* * * * * * * * *
* * * * * * * * * * *
* * * * * * * * * * * * *
* * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * *
* * * * * * * * * * * * *
* * * * * * * * * * *
* * * * * * * * *
* * * * * * *
* * * * *
* * *
"""
for i in range(0, 7 + 1):
for j in range(0, 2 * 7 + 1):
# Left part of pattern
if (i < j):
print("", end = " ");
else:
print("*", end = " ");
# Right part of pattern
if (i <= ((2 * 7) - j)):
print("", end = " ");
else:
print("*", end = " ");
print("");
# This is lower
# half of pattern
for i in range(0, 7 + 1):
for j in range(0, 2 * 7 + 1):
# Left part of pattern
if (i > (7 - j + 1)):
print("", end = " ");
else:
print("*", end = " ");
# Right part of pattern
if ((i + 7) > j):
print("", end = " ");
else:
print("*", end = " ");
print("");