Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Text values
Variables
Functions
19. Functions and variables
Summary

Instruction

Great job! Let's get back to functions.

Up until now, we've been passing in hard-coded values to our functions, but variables can also be passed in as arguments. For example, if a person's body weight of 85.4 kilograms has been saved in a variable named weight, then that variable can be used in the round function, like so

round(weight)

Here, the value stored in the variable weight is used within the function for x and is rounded to the nearest integer value. The function then returns the value 85.

Exercise

We've defined a variable named weight_pounds to represent Tanya's weight in pounds. Round the value stored in this variable to the nearest integer.