Difference between revisions of "Turtle - House Function Assignment"
From WLCS
(Created page with "'''Objectives:''' * The student will create a program that defines and calls a function to draw houses * After creating this program, the student will be able to: ** Define a Pyt...") |
|||
Line 27: | Line 27: | ||
goto(0,200) | goto(0,200) | ||
house() | house() | ||
+ | |||
+ | exitonclick() | ||
</source> | </source> |
Revision as of 21:58, 19 September 2011
Objectives:
- The student will create a program that defines and calls a function to draw houses
- After creating this program, the student will be able to:
- Define a Python function
- Make a Python function call
Resources:
Directions:
- Open Wing IDE
- Create a Python program named houses
- At the top of your program, you should have from turtle import *
- Define a function named house that draws a house like the one below
- Make 3 goto() and 3 house() function calls
from turtle import *
def house():
#YOUR CODE HERE
goto(-200,0)
house()
goto(200,0)
house()
goto(0,200)
house()
exitonclick()