Gettin' Trig-y with Python
9-12
Gettin' Trig-y with Python
In this Python coding activity, students will write a program that generates a random sine, cosine or tangent ratio. It will ask the user to enter a different trigonometric ratio based on the given triangle information. It will evaluate the user’s input.
- Use the input function and a variable to collect and store data from a user
- Use the randint function to generate triangle side lengths
- Use the randint function to determine sine, cosine, or tangent prompts
- Use if..elif..else statements to make decisions
- Use the Pythagorean Theorem to find missing triangle side lengths
- Use right triangle trigonometry ratios to solve problems
For this lesson, students will write a program that generates a random sine, cosine or tangent ratio. It will ask the user to enter a different trigonometric ratio based on the given triangle information. It will evaluate the user’s input. If the user’s input is incorrect, it will give the correct ratio.

9-12
Vernier EasyData,Vernier EasyLink and Vernier EasyTemp are registered trademarks of Vernier Science Education.