Question
1. Read a number from the user in the terminal. This number will be the distance from the Earth to the Sun in miles. (This
1. Read a number from the user in the terminal. This number will be the distance from the Earth to the Sun in miles. (This number does not have to be real but make it larger than one million).
2. Convert that number to an integer.
3. Use that value to calculate the same distance in kilometers (save to a variable). Print out this value. (This variable should be a floating point). (Hint: there are 1.6 kilometers in a mile.)
4. Use the kilometers variable to calculate the distance in astronomical units (AU). Print out this value. (Hint: there are 150,000,000 kilometers in 1 AU.)
5. Calculate the distance in lightyears. Print out this value. (Hint: there are 5.88x10^12 miles in 1 lightyear.) (python code also having to use integers.)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started