67.6k views
5 votes
# 1) Complete the function to return the result of the conversion

def convert_distance(miles):
km = miles * 1.6 # approximately 1.6 km in 1 mile

my_trip_miles = 55

# 2) Convert my_trip_miles to kilometers by calling the function above
my_trip_km = ___

# 3) Fill in the blank to print the result of the conversion
print("The distance in kilometers is " + ___)

# 4) Calculate the round-trip in kilometers by doubling the result,
# and fill in the blank to print the result
print("The round-trip in kilometers is " + ___)

1 Answer

4 votes

Answer:

See explanation

Step-by-step explanation:

Replace the ____ with the expressions in bold and italics

1) return km

return km returns the result of the computation

2) = convert_distance(my_trip_miles)

convert_distance(my_trip_miles) calls the function and passes my_trip_miles to the function

3) + str(my_trip_km)

The above statement prints the returned value

4) +str(my_trip_km * 2)

The above statement prints the returned value multiplied by 2

User Yang Peiyong
by
4.7k points