Write a program that prints a giant letter A like the one below. Allow the user to specify how
large the letter should be.
def print_diamond_outline(size):
# Print the top half of the diamond outline
for i in range(size - 1):
# Print the spaces
for j in range(size - i - 1):
print(' ', end='')
# Print the stars
if i == 0:
# Print full line of stars for the top row
for j in range(2 * i + 1):
print('*', end='')
elif i == size // 2:
# Print seven stars for the middle row
for j in range(size+1):
print('*', end='')
else:
# Print only the first and last stars for the other rows
print('*', end='')
for j in range(2 * i - 1):
print(' ', end='')
print('*', end='')
# Move to the next line
print()
# Test the
print_diamond_outline(10)
0 Comments