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.) The previous output used a constant height of 5. The following are the outputs for constant heights of 3 and 6:

Height 3
////////\\\\\\\\
////********\\\\
****************

Height 6
////////////////////\\\\\\\\\\\\\\\\\\\\
////////////////********\\\\\\\\\\\\\\\\
////////////****************\\\\\\\\\\\\
////////************************\\\\\\\\
////********************************\\\\
****************************************

(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.