YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← 01-27 Variables Quiz Solution

01-27 Variables Quiz Solution

Get Embed Code
4 Languages

Showing Revision 5 created 05/07/2015 by Udacity Robot.

  1. So, here's one way to answer this question. We have
  2. our two variable definitions. We can print out the distance
  3. light travels in one cycle by dividing speed of light
  4. by cycles per second using the variables, and when we
  5. run that we see the result is 0.11. So, that's
  6. 0.11 meters, or 11 centimeters. Another way to solve this
  7. that might be better would be to introduce another variable.
  8. So, instead of just printing the result, we can store
  9. it in a variable. We'll call it cycle_distance. Now, when
  10. we run it, there's no result. We haven't printed that
  11. out yet. But we've stored it in a variable. And
  12. now, we can print out the result of cycle_distance. Which gives
  13. us the 11, 0.11 meters. If we want the result
  14. in centimeters, well since we've already stored the result in meters
  15. in a variable, we can compute that by just multiplying
  16. that by 100. And now we get the result in centimeters.