| 23 | |
| 24 | |
| 25 | def displayOutlineDiamond(size): |
| 26 | # Display the top half of the diamond: |
| 27 | for i in range(size): |
| 28 | print(' ' * (size - i - 1), end='') # Left side space. |
| 29 | print('/', end='') # Left side of diamond. |
| 30 | print(' ' * (i * 2), end='') # Interior of diamond. |
| 31 | print('\\') # Right side of diamond. |
| 32 | |
| 33 | # Display the bottom half of the diamond: |
| 34 | for i in range(size): |
| 35 | print(' ' * i, end='') # Left side space. |
| 36 | print('\\', end='') # Left side of diamond. |
| 37 | print(' ' * ((size - i - 1) * 2), end='') # Interior of diamond. |
| 38 | print('/') # Right side of diamond. |
| 39 | |
| 40 | |
| 41 | def displayFilledDiamond(size): |