Answered step by step
Verified Expert Solution
Link Copied!

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:
draw_house(height, breadth, roof_base)
This function will draws a house of height (to the base of the roof) height units, of breadth breadth units
and the roof is root_base units wide. Calling draw_house (100,150,200) 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-
and-right symmetrical.You might have learnt some of the Python Turtle functions in lecture/tutorial. 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
backward(distance) : 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
fd,bk(or back), rt and lt 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)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Accounting

Authors: Joe Hoyle, Thomas Schaefer, Timothy Doupnik

10th edition

0-07-794127-6, 978-0-07-79412, 978-0077431808

Students also viewed these Databases questions