Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Now you try! With the functions that you have learnt so far, write a function with function header: draw _ house ( height , breadth,
Now you try!
With the functions that you have learnt so far, write a function with function header:
drawhouseheight breadth, roofbase
This function will draws a house of height to the base of the roof height units, of breadth breadth units
and the roof is rootbase units wide. Calling drawhouse will result in something like the
following. It does not matter how the roof of the house looks like, but make sure your drawn house is left
andright symmetrical.You might have learnt some of the Python Turtle functions in lecturetutorial Here are a few questions to
really test your understanding of how they work, and a very simple drawing to get you acquainted with
drawing with Turtle!
Some of the functions covered are:
pd: Pen down. Any movements thereafter will be traced
pu : Pen up Any movements thereafter will NOT be traced
forward distance : Moves the turtle forward a number of units specified by distance
backwarddistance : Moves the turtle backward a number of units specified by distance
right degrees : Turns the turtle right by a certain number of degrees specified
left degrees : Turns the turtle left by a certain number of degrees specified
Note: the direction functions forward, backward, right and left all have shorthands, which are
or back rt and respectively. Use any of these shorthands or full names as you prefer.
Warmup
In the following sequences of function calls, try to imagine what will be drawn. Then, run the calls yourself
on Python. Did it draw what you had expected? Note: This part is not graded and is only for your own
practice. There is no need to copy your answers from this part to Coursemology
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started