logo CodeStepByStep logo

slash_figure2

Modify the slash_figure function from the previous exercise to produce a new function slash_figure2 that refers to a global constant named SIZE representing the figure's height. The previous output used a constant height of 6. Here is the output for a constant height of 4 and 7 respectively.

size 4 size 7
!!!!!!!!!!!!!!
\\!!!!!!!!!!//
\\\\!!!!!!////
\\\\\\!!//////
!!!!!!!!!!!!!!!!!!!!!!!!!!
\\!!!!!!!!!!!!!!!!!!!!!!//
\\\\!!!!!!!!!!!!!!!!!!////
\\\\\\!!!!!!!!!!!!!!//////
\\\\\\\\!!!!!!!!!!////////
\\\\\\\\\\!!!!!!//////////
\\\\\\\\\\\\!!////////////

(You must solve this problem using only ONE constant named exactly SIZE, not multiple constants; and its value must be used in the way described in this problem. Do not define the constant in your own code; we will define it in our testing code, and you should use it in your function.)

Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.