Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Code the function draw_E() with the parameters width and height. The top (bottom

ID: 3739931 • Letter: C

Question

Code the function draw_E() with the parameters width and height. The top (bottom) horizontal line is width characters long and the middle line is width // 2 characters long. The other horizontal lines are width // 4 characters long. Each “block” has height // 5 rows. (We are assuming that width and height are not too small.)

Code the function draw_L() with the parameters width and height. The bottom horizontal line is width characters long and the other horizontal lines are width // 4 characters long. The character has height rows total and height // 5 of them are the ones with width characters horizontally. (Again, we are assuming that width and height are not too small.)

Explanation / Answer

def draw_E(width, height): for i in range(height//5): for j in range(width): print('E', end='') print() for i in range(height//5): for j in range(width//4): print('E', end='') print() for i in range(height//5): for j in range(width//2): print('E', end='') print() for i in range(height//5): for j in range(width//4): print('E', end='') print() for i in range(height//5): for j in range(width): print('E', end='') print() draw_E(15, 20)