Difference between revisions of "Turtle - House Function Assignment"

From WLCS
Line 31: Line 31:
 
exitonclick()
 
exitonclick()
 
</source>
 
</source>
 +
 +
[[File:house.png]]

Revision as of 22:13, 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:

  1. Open Wing IDE
  2. Create a Python program named houses
  3. At the top of your program, you should have from turtle import *
  4. Define a function named house that draws a house like the one on the board
  5. Make 3 goto() and 3 house() function calls
from turtle import *

def house():
  #YOUR CODE HERE

penup()
goto(-200,0)
house()
goto(200,0)
house()
goto(0,200)
house()

exitonclick()

House.png