Functions

Writing Functions


Write a function that converts pounds to grams (there are 453.592 grams in one pound). Use that function and a built in function to print out how many grams there are in 3.75 pounds, rounded to the nearest gram.

Don’t do any printing or rounding inside your function. You want each function to do one thing and do it well, and in this case that thing is converting pounds to grams. Have the function do the conversion and then do the rounding and printing outside of the function.

[click here for output]