This course will be retired on June 1, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Let's take what we've learned about variables and operators to create a simple unit converter that can convert pounds to kilograms and miles to kilometers.
Conversions
$lb_to_kg = 0.453592;
$mile_to_km = 1.60934;
1 pound = 0.453592 kilogram
1 kilogram = 2.20462 pounds
1 mile = 1.60934 kilometers
1 kilometer = 0.621371 miles
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up