1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sergey [27]
3 years ago
14

Light travels at 3 × 108 meters per second. A light-year is the distance a light beam travels in one year.Write a PYTHON program

that calculates and displays the value of a light-year.Useful facts:Seconds in a year = 365×24×602Rate = 3×108meters per second
Computers and Technology
1 answer:
Volgvan3 years ago
4 0

Answer: This is a python code

def lightyear():

   rate=3*100000000   //speed of light

   seconds=365*24*60*60   //number of seconds in 1 year

   return str((rate*seconds)/1000)+" km"    //distance=speed x time

print(lightyear()) //will print value of light hear in kilometers

OUTPUT :

9460800000000.0 km

Explanation:

In the above code, there is a variable rate, which stores the speed of light, i.e. distance traveled by light in 1 second which is in meters. Another variable is seconds, which store the number of seconds in 1 year, which is no of days in 1 year multiplied by the number of hours in a day multiplied by the number of minutes in an hour multiplied by the number of seconds in a minute. Finally, distance is speed multiplied by time, so distance is printed in kilometers and to convert distance in kilometers it is divided by 1000.

You might be interested in
How many wires are in a standard Cat 6 cable?
Lynna [10]
I believe it is 8

Hope this helps
5 0
2 years ago
Read 2 more answers
When computing effect size, the sample size is ________.
NNADVOKAT [17]
Sample size  is not taken into account

8 0
3 years ago
Why did they removed the watch video button to view answers?​
MA_775_DIABLO [31]

Answer:

Umm I’m not sure

Explanation:

7 0
3 years ago
Clicking a _____ name opens a drop-down list of commands and options.
UkoKoshka [18]
Clicking a menu opens a drop-down list of commands and options. According to Merriam dictionary, menu is defined as a list of things that you can choose from ; especially computers or a list shown on a computer from which you make choices to control what the computer does.
6 0
3 years ago
The ____ attribute lets you control how the internal table gridlines are drawn.
nevsk [136]
<span>cell spacing is the answer</span>
4 0
3 years ago
Other questions:
  • The title of a Web page is the text that appears on the title bar and taskbar of the browser window. *
    13·1 answer
  • Does a soda vending machine Give reciepts?<br><br>need for computer science hw
    7·2 answers
  • Write a program that computes and displays a 15 percent tip when the
    9·1 answer
  • Jennifer has written a business report. What should be her last step before she submits the story for publication?
    10·2 answers
  • Develop a Matlab program that allows you to plot the entropy of a source with variable output probabilities. We wish to observe
    8·1 answer
  • What refrigerant has been approved for new household refrigerators and freezers
    14·1 answer
  • For what purpose is IT used in business?
    7·1 answer
  • Horizontal and vertical flips are often used to create ___.
    12·1 answer
  • Choose the correct line of code.
    7·1 answer
  • Pls help me po:{<br><br> I need the answer lang po talaga , pls:{
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!