HomepageTeaching PageResearch PageResources Page

Homework: Simple Repetition

Start reading section 4.1 in the book.

When using turtles in scripts, you'll want to do the following:

#up at the top with other import statements
import turtle

...
#main method for testing
def main():
    
    ...
    
    raphael = turtle.Turtle() #a turtle for testing a specific function
        

Now finish reading section 4.1, then read 4.2.

Notice that we can call a function inside of a for loop.

def print_twice(word):
    print(word)
    print(word)
    
for i in range(4):
    print_twice("monkey")
        

How many times is the word monkey going to be printed? Try it out!