Creating a Unit Conversion Tool6:43 with Alena Holligan
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.
$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
You need to sign up for Treehouse in order to download course files.Sign up