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
Which of the following are examples of software? (Select all that apply)
olchik [2.2K]
Put a photo or something
8 0
2 years ago
Read 2 more answers
Concept of CPU scheduler?​
vekshin1

Answer:

CPU scheduling is a process which allows one process to use the CPU while the execution of another process is on hold(in waiting state) due to unavailability of any resource like I/O etc, thereby making full use of CPU. ... The selection process is carried out by the short-term scheduler (or CPU scheduler).

6 0
3 years ago
Given a sorted list of integers, output the middle integer. assume the number of integers is always odd.
Svetllana [295]

integer userInput

integer i

integer mid

integer array(20) number

userInput = 1

for i = 0; userInput >= 0; i = i + 1

  if number[i] > -1

     userInput = Get next input

     number[i] = userInput

i = i - 1

mid = i / 2

if i > 9

  Put "Too many inputs" to output

elseif i % 2 == 0

  Put number[mid - 1] to output

else

  Put number[mid] to output

4 0
2 years ago
While storms could be a cause, power______ are more likely to be caused by disturbances from high-demand equipment in a home or
Troyanec [42]

Answer:

outages

Explanation:

While storms could be a cause, power <u>outages</u> are more likely to be caused by disturbances from high-demand equipment in a home or building

8 0
2 years ago
Which statements describe OneDrive?
Vesna [10]

Answer:

OneDrive is a storage location on your personal computer.

Explanation:

Its gives u extra storage as well as helps u to take backup for all ur files that are important to u

Hope this helps...

Pls mark my ans as brainliest

If u mark my ans as brainliest u will get 3 extra points

6 0
3 years ago
Read 2 more answers
Other questions:
  • Professor Zak allows students to drop the four lowest scores on the ten 100 point quizzes she gives during the semester. Design
    13·1 answer
  • A ________ restricts the number of a certain type of product that can be imported into a country.
    5·1 answer
  • A company uses the account code 669 for maintenance expense. However, one of the company's clerks often codes maintenance expens
    15·1 answer
  • Create a calendar named fitness and then display it in a calendar view with the default calendar.
    15·1 answer
  • An application with which you can perform calculations on numbers and work with other data
    8·1 answer
  • You are requesting information about wireless connectivity for your workplace computers. Because you expect the information to b
    15·1 answer
  • My computer just fried anybody know why it did that?
    14·2 answers
  • Declare an ArrayList of Strings. Add eight names to the collection. Output the Strings onto the console using the enhanced for l
    9·1 answer
  • Yo, how can I bypass the securely filter on a chromebook?
    15·1 answer
  • THIS IS TIMED PLS HURRY UP
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!