logo CodeStepByStep logo

ascii_figure2

Language/Type: Python for

Write a modified version of the ascii_figure function from the previous problem named ascii_figure2 to use a constant named HEIGHT for the figure's height. (You may want to make loop tables first.) Declare this as a global named HEIGHT at the top of your solution, outside your function. The previous output used a constant height of 5. The following are the outputs for constant heights of 3 and 6:

HEIGHT of 3:

////////\\\\\\\\
////********\\\\
****************

HEIGHT of 6:

////////////////////\\\\\\\\\\\\\\\\\\\\
////////////////********\\\\\\\\\\\\\\\\
////////////****************\\\\\\\\\\\\
////////************************\\\\\\\\
////********************************\\\\
****************************************
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.