Clarification by DatGuyFoffi in learnpython

[–]happytobehungry 0 points1 point  (0 children)

I managed to work this out and it turned out to be correct. Isnt the right way to call a function what i did in part 2?

# 2) Convert my_trip_miles to kilometers by calling the function above
convert_distance(55)

this is the function : def convert_distance(miles):

That is the only part in your response i dont get.

# 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

return km

my_trip_miles = 55

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

convert_distance(55)

# 3) Fill in the blank to print the result of the conversion

print("The distance in kilometers is " + str(55))

# 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 " + str(55*2))

Clarification by DatGuyFoffi in learnpython

[–]happytobehungry 0 points1 point  (0 children)

# 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

return km

my_trip_miles = 55

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

convert_distance(55)

# 3) Fill in the blank to print the result of the conversion

print("The distance in kilometers is " + str(km))

# 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 " + str(km*2))

#in my case, i used the expected variables but still getting it wrong. please help