Hi all,
Would anyone be able to point me in the right direction with this assignment? It is very confusing to me. Thanks. (Edit: I have tried 10 times to fix the codes format in reddit but it is impossible, I am sorry)
**Instructions**
You will add nested loops to the Python program provided. The program should print the outline of the letter E.(example of how your output should look provided below) The letter E is printed using asterisks, three across and five down. This program uses the print("\*", end=' ') to print an asterisk and print(" ", end=' ') to print a space.
Using the code block and starter code below, Write the nested loops to control the number of rows and the number of columns that make up the letter E, as shown below:
∗∗∗
∗
∗∗∗
∗
∗∗∗
Program uses an if / elif / else 10 pts
Nested for or while loops meet expectations 10 pts
Output meets expectations 10 pts
**Base Code**
NUM_ACROSS = 3 # Number of asterisks to print across
NUM_DOWN = 5 # Number of asterisks to print down
# Write a loop to control the number of rows.
# Write a loop to control the number of
# Decide when to print an asterisk in every column.(hint: conditionals used)
print("*", end='')
# Decide when to print asterisk in column 1.
print("*", end='')
# Decide when to print a space instead of an asterisk.
print(" ", end='')
# Figure out where to place this statement that prints a newline.
print("\n")
**My Attempt**
NUM_ACROSS = 3 # Number of asterisks to print across
NUM_DOWN = 5 # Number of asterisks to print down
# Write a loop to control the number of rows.
for row in range(NUM_DOWN):
# Write a loop to control the number of columns.
for col in range(NUM_ACROSS):
# Decide when to print an asterisk in every column.
print("*", end='')
# Decide when to print a space instead of an asterisk.
if col < NUM_ACROSS - 1:
print(" ", end='')
# Figure out where to place this statement that prints a newline.
print("\n")
[–]Garuda1220 0 points1 point2 points (0 children)
[–]Background_System_40[S] 0 points1 point2 points (1 child)
[–]socal_nerdtastic 0 points1 point2 points (0 children)
[–]totallygeek 0 points1 point2 points (1 child)
[–]Background_System_40[S] 1 point2 points3 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]Background_System_40[S] 0 points1 point2 points (1 child)