answer.
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
Dimas [21]
1 year 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:
Art [367]1 year 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
Drag each tile to the correct box.
Likurg_2 [28]
Learning
planning
designing
developing
testing delivering
4 0
1 year ago
Wesley has to create a web banner to announce a “Back to School” sale by an online retailer. Which information should he determi
olganol [36]
I would say A :)))))))
4 0
2 years ago
Read 2 more answers
Dani is paraphrasing from a paragraph of an article for a post on her blog. Which of the following strategies is least likely to
koban [17]
I would say A. She reads the entire paragraph, then rewrites it in her own words, and then checks to make sure her version is not too similar to the text from the article.


All the other ones are a little too obvious.


Hope this helps you, baii <33

4 0
2 years ago
Read 2 more answers
Jason has decided to use his name on all the images to protect them from misuse. He has also decided to use the logo of his comp
Mila [183]

Answer:

Text watermarking involves adding the photographer's name at the corner of the image.

Explanation:

This was one of the correct answers when I took the test, I got it wrong because I didn't pick all the correct answers. I hope that this was helpful to you! If you know the other correct answer(s) please comment and let me know and i'll edit this answer! :)

6 0
1 year ago
Read 2 more answers
More Loops: All versions of foods.py in this section have avoided using for loops when printing to save space. Choose a version
Nata [24]

Answer:

Following are the program in the Python Programming Language.

#set list type variable and initialize the elements

myPizza = ['Margarita', 'Capsicum and onion', 'Chicken']

#set variable and initialize the elements

frndPizzas = myPizza[:]

#append value in list variable

myPizza.append('Corn')

#append value in list variable

frndPizzas.append('paperica')

#print message

print("My pizzas are:")

#set the for loop and print elements of 1st list

for pizza in myPizza:

   print(pizza)

#print message

print("\nFriend's pizzas are:")

#set the for loop and print elements of 2st list

for frndsPizza in frndPizzas:

   print(frndsPizza)

<u>Output</u>:

My pizzas are:                                                                                                                  

Margarita                                                                                                                       Capsicum and onion                                                                                                               Chicken                                                                                                                          Corn                                                                                                                                                                                                                                                        

Friend's pizzas are:                                                                                                            

Margarita                                                                                                                      Capsicum and onion                                                                                                              Chicken                                                                                                                         paperica    

Explanation:

<u>Following are the description of the program</u>:

  • Set a list data type variable that is 'myPizza' and initializes elements in it.
  • Set another list data type variable that is 'frndPizzas' and initializes elements in it.
  • Append one-one element in both of the list data type variables.
  • Set the for loops to print the elements of both list data type variables.
5 0
1 year ago
Other questions:
  • Write the definition of a function dashedline, with one parameter , an int . if the parameter is negative or zero, the function
    15·1 answer
  • Five routers are to be connected in a point-to-point subnet. between each pair of routers, the designers may put a high-speed li
    8·1 answer
  • Which of the following is not true about VOIP?
    9·1 answer
  • Which one of the following is a correct declaration for a method named passAList that has as arguments an array list myList of s
    8·1 answer
  • Wendy is an attacker who recently gained access to a vulnerable web server running Microsoft Windows. What command can she use t
    9·1 answer
  • Write a loop that continually asks the user what pets the user has, until the user enters "rock", in which case the loop ends. I
    12·1 answer
  • A security administrator is implementing a SIEM and needs to ensure events can be compared against each other based on when the
    11·1 answer
  • A script sets up user accounts and installs software for a machine. Which stage of the hardware lifecycle does this scenario bel
    5·1 answer
  • A mobile device user has tried to install a new app numerous times without success. She has closed all unused apps, disabled liv
    7·1 answer
  • Match the following technologies with their applications.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!