-3

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

Za123
  • 3
  • 1
  • 2
    Please do __not__ [post code as image](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question). Instead, copy all of it and format it using the adequate tools available when writing your question. Also include the full error and stacktrace as code/text. – MatBBastos Nov 18 '21 at 21:14

2 Answers2

0

Though it looks like it's indented correctly, check and make sure you are not mixing tabs and spaces. In Python it is recommended to use spaces. Your text editor should have a setting for using spaces instead of tabs (\t). Whichever one you use, tabs or spaces, you have to use them exclusively, you cannot mix them.

0

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)

Fatin Ishrak Rafi
  • 339
  • 1
  • 3
  • 11
  • @Za123 I appreciate it. No need to say thanks in the comments. This community is made for helping each other. Hence, the best way to say thanks is upvoting the answer. Please read the community rules. Best wishes on learning Python. – Fatin Ishrak Rafi Nov 18 '21 at 23:59