-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswastika-and-reverse.py
More file actions
66 lines (61 loc) · 1.89 KB
/
Copy pathswastika-and-reverse.py
File metadata and controls
66 lines (61 loc) · 1.89 KB
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
61
62
63
64
65
66
def swastika(row,col):
for i in range(row):
for j in range(col):
if(i < row // 2):
if (j < col // 2):
if (j == 0):
print("*", end = "")
else:
print(" ", end = " ")
elif (j == col // 2):
print(" *", end = "")
else:
if (i == 0):
print(" *", end = "")
elif (i == row // 2):
print("* ", end = "")
else:
if (j == col // 2 or j == col - 1):
print("* ", end = "")
elif (i == row - 1):
if (j <= col // 2 or j == col - 1):
print("* ", end = "")
else:
print(" ", end = " ")
else:
print(" ", end = " ")
print()
def revswastika(row, col):
for i in range(row):
for j in range(col):
if (i < row // 2):
if (j < col // 2):
if (i == 0 and i < row // 2):
print("* ", end = "")
else:
print(" ", end = " ")
elif (j == col // 2):
print("*", end = "")
else:
if (i < row // 2 and j < col - 1):
print(" ", end = " ")
if (j == col - 1):
print(" *", end = "")
elif (i == row // 2):
print("* ", end = "")
else:
if (j == col // 2 or j == 0):
print("* ", end = "")
elif (i == row - 1):
if (j <= col // 2 or j == col):
print(" ", end = " ")
else:
print("* ", end = "")
else:
print(" ", end = " ")
print()
row = 7; col = 7
print("Swastik Pattern")
swastika(row, col)
print("Swastik Reverse Pattern")
revswastika(row, col)