Question: General imports, like import math, make all functionality from the math package available to you. However, if you decide to only use a specific part
General imports, like import math, make all functionality from the math package available to you. However, if you decide to only use a specific part of a package, you can always make your import more selective:
from math import pi
Let's say the Moon's orbit around planet Earth is a perfect circle, with a radius r in km that is defined in the script.
Instructions
XP
Perform a selective import from the math package where you only import the radians function.
Calculate the distance travelled by the Moon over degrees of its orbit. Assign the result to dist. You can calculate this as r phi, where r is the radius and phi is the angle in radians. To convert an angle in degrees to an angle in radians, use the radians function, which you just imported.
Print out dist.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
