Education Technology

Putt Putt with Python

Activity Overview

In this coding activity for the TI-84 Plus CE Python edition, students will create a golf game.  The golf game gives the user two random points, one for the golf ball and one for the golf hole.  The user will enter a value for the slope.

Objectives

  • Use the input function and a variable to collect and store data from a user
  • Use the randint() function to generate random integers
  • Use the plot library to plot points
  • Use the plot library to plot a line segment
  •  Use the point slope form of a line to plot a line segment

About the Lesson

In this lesson, students will create a golf game using the Python Editor.  The game code will randomly generate a location for the golf ball and the hole. To take a shot, the user will enter a linear equation in point-slope form that models the path for the shot.  The program will plot the golf ball, hole and shot.

Note: This lesson requires the use of TI-84 Plus CE Python technology with OS 5.6 and above.