Education Technology

Explorations with Coding: Putt Putt with Python

by Texas Instruments

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.