pythoncoursera-api

How do I answer this Coursera python question


I am very new to coding and currently attempting to teach myself how to code via coursera. I am on the week 2 problems and cannot get the code to work, and coursera does not show any solutions ever even if you get it wrong. Any explanation on how to do the problem/ what I am doing wrong would be much appreciated.

enter image description here


Solution

  • You have extra indentation after km. Remove all white space after the return km.

    In line 9 it will be my_trip_km = convert_distance(my_trip_miles)

    in line 12 in blank it will be my_trip_km

    in line 16 round(my_trip_km)