[Tutor] Turtle graphics - was Re: (no subject)

Alan Gauld alan.gauld at yahoo.co.uk
Sat Oct 27 08:34:38 EDT 2018


On 27/10/2018 12:09, Jesse Stockman wrote:
> Hi there 

Hi, Please always provide a meaningful subject line.

Also always include the output of your program,
especially if its an error message - these are
full of useful information.

> I need to draw a patten with turtle in python 3.7 but > I cant get it to work here are the specs of the pattern
> and my code so far can you please help
> 
> • Specifications of the pattern o The radius of the three heads is 10. 
...

Since the specs provide the sizes you don't need
all the input() calls, just use the data.
It's much faster to run and test that way.

> def main():
>     speed(0)
>     pensize(3)
>     pencolor("black")
>     
>     winner_color = "red"
>     second_color = "orange"
>     third_color = "purple"
>     draw_podium(winner_color, second_color, third_color)

Where is draw_podium defined?

>     darw_third(third_color)

Check the spelling here? And also, where is draw_third()
defined (or even darw_third)

>     draw_winner(winner_color)
>     draw_second(second_color)

You can't call functions that don't exist.
They must either be provided by an imported module
or defined by you.


> def move_to(x, y):...
>     
> def draw_head(x, y, radius):...

> def draw_line(x1, y1, x2, y2):...

> def draw_block(x, y, hight, width, color):...

> main()    
> draw_block(x, y, hight, width, color)
> exitonclick()

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos



More information about the Tutor mailing list