227k views
5 votes
This function converts miles to kilometers (km).

Complete the function to return the result of the conversion
Call the function to convert the trip distance from miles to kilometers
Fill in the blank to print the result of the conversion
Calculate the round-trip in kilometers by doubling the result, and fill in the blank to print the result

1 Answer

0 votes

Answer:

In Python:

def miles_to_km(miles):

km = miles * 1.60934

roundtrip = km * 2

print("Kilometre: "+str(km))

print("Roundtrip: "+str(roundtrip))

Step-by-step explanation:

The question has missing details. So, I start from scratch

This defines the function

def miles_to_km(miles):

This converts miles to km

km = miles * 1.60934

This calculates the round-trip

roundtrip = km * 2

This prints the distance in kilometers

print("Kilometre: "+str(km))

This prints the round-trip

print("Roundtrip: "+str(roundtrip))

User Dropson
by
4.2k points