## Got a YouTube account?

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

## ← 01-27 Variables Quiz Solution

• 2 Followers
• 16 Lines

01-27 Variables Quiz Solution

### Get Embed Code x Embed video Use the following code to embed this video. See our usage guide for more details on embedding. Paste this in your document somewhere (closest to the closing body tag is preferable): ```<script type="text/javascript" src='https://amara.org/embedder-iframe'></script> ``` Paste this inside your HTML body, where you want to include the widget: ```<div class="amara-embed" data-url="http://www.youtube.com/watch?v=PUL5crPr3n8" data-team="udacity"></div> ``` 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.