Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 575 Bytes

Functions-writing-functions-Python.md

File metadata and controls

15 lines (13 loc) · 575 Bytes
layout topic title language
exercise
Functions
Writing Functions
Python

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.