-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDaimonds.py
More file actions
36 lines (29 loc) · 873 Bytes
/
Copy pathDaimonds.py
File metadata and controls
36 lines (29 loc) · 873 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
def main():
print('Diamonds, bys sinistergeek')
for diamondSize in range(0,6):
displayOutlineDiamond(diamondSize)
print()
displayFilledDiamond(diamondSize)
print()
def displayOutlineDiamond(size):
for i in range(size):
print(' ' * (size - i - 1),end='')
print('/',end='')
print(' '*(i*2),end='')
print('\\')
for i in range(size):
print(' ' * i, end=' ')
print('\\',end='')
print(' ' * ((size - i - 1) *2),end=' ' )
print('/')
def displayFilledDiamond(size):
for i in range(size):
print(' ' *(size - i - 1),end=' ')
print('/' *(i + 1),end='')
print('\\'*(i+1))
for i in range(size):
print(' ' * i,end='')
print('\\' * (size - i),end='')
print('/' * (size - i))
if __name__ == '__main__':
main()