Exercise Solutions¶
These are a solution to each exercise. There is usually more than one way to solve a problem, so any program that produces the required result solves it.
Lesson 1: Thonny Introduction¶
Exercise 1¶
Exercise 2¶
Exercise 3¶
Lesson 2: Introducing Turtle¶
Exercise 1¶
Exercise 2¶
Exercise 3¶
Lesson 3: Iteration¶
Exercise 1¶
Exercise 2¶
Exercise 3¶
Come in and sit down is printed six times, once after each How are you?. Indenting the line makes it part of the for loop's code block, so it repeats every time the loop repeats instead of running once after the loop has finished.
Lesson 4: Range¶
Exercise 1¶
Exercise 2¶
Exercise 3¶
Exercise 4¶
Exercise 5¶
This is one idea: a square spiral that grows as the loop repeats, because the turtle moves forward by the loop's current number each time.
Lesson 5: Variables¶
Exercise 1¶
Exercise 2¶
Exercise 3¶
Lesson 6: Coordinates¶
This is the house from the start of Lesson 7.