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 are 5 good movies like The Breakfast Club or 8 Mile?
Gnoma [55]

Answer:

The Notebook, Beauty and the Beast, Step Brother, The Breakfast Club and The Little Mermaid

Explanation:

8 0
3 years ago
Read 2 more answers
An effective problem statement ensures that
swat32
The software design effectively addresses the issues
6 0
3 years ago
3.18: Pizza Pi Joe’s Pizza Palace needs a program to calculate the number of slices a pizza of any size can be divided into. The
alina1380 [7]

Answer:

#program in python.

#variables

slice_area=14.125

pi=3.14159

#read diameter

d=int(input("Enter diameter of pizza:"))

#area of pizza

area=pi*(d/2)*(d/2)

#number of slice

no_slice=int(area/slice_area)

#print slice

print("total silce are:",no_slice)

Explanation:

Declare and initialize a variable "slice_area" with 14.125 which is the area of a pizza slice.Initialize a variable "pi" with 3.14159.Then read the diameter of pizza.Find the area of pizza as "area=pi *d/2*d/2".Divide the total area with area of pizza slice.This will be the number of slice.

Output:

Enter diameter of pizza:20                                                                                                

total silce are: 22

6 0
3 years ago
The two key elements of any computer system are the ________ and the ________.
mezya [45]
The second the hardware and the software
5 0
3 years ago
Which of the following represents the bus topology? Multiple Choice All devices are connected to a central device, called a hub.
Yanka [14]

Answer: All devices are connected to a central cable or backbone.

Explanation:

"All devices are connected to a central cable or backbone". Bus Topology refers to a logical or physical network's design. Bus Topology is also the network setup for a LAN (Local Area Network) nodes connected to a "backbone" or cable. The Bus setup connects every single computer and network to a single cable. Among others, the type of cable implemented for bus topology is usually a coaxial cable.

3 0
3 years ago
Other questions:
  • To create a button that will allow a user to send the form data to the server you use a type of ____
    5·1 answer
  • Which scenario depicts an ethical workplace practice by a business owner? A. sharing personal information of its employees with
    8·2 answers
  • A group of students are collaborating on an online research project. What is an example of appropriate online behavior?
    10·2 answers
  • What is an IP address and where I can find the IP address for my computer?
    14·1 answer
  • What is virtualization?
    11·2 answers
  • An ip address in the address range 169.254.x.y, used by a computer when it cannot successfully lease an ip address from a dhcp s
    6·1 answer
  • You are a computer consultant called in to a manufacturing plant. The plant engineer needs a system to control their assembly li
    10·1 answer
  • When browsing using certain browsers, if a page is known to be malicious or using phishing techniques in the past a browser may
    5·1 answer
  • Modern Computers compared to earlier computers are
    10·1 answer
  • Connect research concepts to their definitions
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!