Education Technology

Putt Putt with Python

Subject Area
STEM & Coding: Computer Science: Computer Science
Level
6-8
9-12
Activity Time
50 Minutes
Software
TI-Nspire™ CX
TI-Nspire™ CX CAS
TI Calculator
TI-Nspire™ CX II
TI-Nspire CX series
TI-Nspire Version
5.2
Resource Types
Lessons
Format
TNS
Python Programming

Putt Putt with Python

Activity Overview

In this coding activity, 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, you will create a golf game using the Python Editor.  Your 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-Nspire™ CX II technology with OS 5.2 and above.

Subject Area
STEM & Coding: Computer Science: Computer Science
Level
6-8
9-12
Activity Time
50 Minutes
Software
TI-Nspire™ CX
TI-Nspire™ CX CAS
TI Calculator
TI-Nspire™ CX II
TI-Nspire CX series
TI-Nspire Version
5.2
Resource Types
Lessons
Format
TNS
Python Programming
iPad is a trademark of Apple Inc., registered in the U.S. and other countries.
Vernier EasyData,Vernier EasyLink and Vernier EasyTemp are registered trademarks of Vernier Science Education.