New content coming soon

Instructions

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

Write a program that calculates and displays the value of a light-year.

Useful facts:

  • Seconds in a year = 365×24×602
  • Rate = 3×108 meters per second

Below is an example of the correct output format:

Light travels X meters in a year.

Flowchart

To enlarge flowchart turn side navigation off, Click on Side Navigation button on in the top navigation bar to change to Side Navigation button off

Flowchart
Flowchart

Starter Code

"""
Program: lightyear.py
Project 2.8

Compute the distance that light travels in a year.

Useful facts:
   rate = 3 * 10 ** 8 meters per second
   seconds in a year = 365 * 24 * 60 ** 2

"""

# Compute the result

# Display the result
Tags: programming