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
What does the internet engineering task force (IEFT) do?
Anvisha [2.4K]

The Internet Engineering Task Force is the premier internet standard body that defines standard internet protocols like TCP/IP. It is a large community that consists of operators, network designers, researchers and vendors drawn from the internet society’s individual and organization bodies and is concerned with the evolution and the smooth operation of the internet.

7 0
3 years ago
Jax needs to write a block of code that will organize a list of items alphabetically. Which function should he use? append() pri
rusak2 [61]

In python, the sort() function will alphabetically sort a list of strings

3 0
3 years ago
What type of function is being performed when a router screens packets based on information in the packet header
Helga [31]

Answer:

"Router screening" is the correct option.

Explanation:

  • A router that philters packets like a firewall. For certain instances, the whole firewall system is such a single scanning router.
  • Often connected to a network stage as well as a container-filter firewall has been the scanning router firewall. This rather firewall operates by filtering protocol characteristics from received packets.

So that the above seems to be the correct approach.

3 0
3 years ago
____________________________ and _________________________ are 2 positive impacts of the internet on businesses.
ZanzabumX [31]
D improved comms and easy ads
4 0
3 years ago
Read 2 more answers
What is the most efficient<br> form of transportation we<br> have?
alisha [4.7K]

Answer:

The bicycle is a tremendously efficient means of transportation. In fact cycling is more efficient than any other method of travel--including walking! The one billion bicycles in the world are a testament to its effectiveness

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • What do yo need to do for device manager to display nonpresent devices?
    9·1 answer
  • What is the keyboard shortcut Ctrl+Z used for?
    14·2 answers
  • A server, also called a(n) _______________, operating system is a multiuser operating system because it controls a central compu
    6·1 answer
  • How might the website owner use theses details other than to verify login details?
    6·2 answers
  • Which of the following is a technique used by hackers to identify unsecured wireless network locations to other hackers?A. Blues
    10·1 answer
  • Does anyone know why I get notifications on Brainly that say they are from 4 hours ago even though they were just answered
    9·1 answer
  • What are digital forensic techniques? A. Identifying, extracting, and evaluating evidence obtained from digital media such as co
    11·1 answer
  • What is the missing line of code?
    10·2 answers
  • The best way to safeguard your document is to save it
    11·1 answer
  • While working in a group of two the members are not getting along. You bring the two members together so they can discuss this i
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!