Week 2 Practice lab: Linear Regression error

When I submit the programming assignment I am getting this error while grading. My code has run successfully.

Your code has indentation problem. If you are not familiar with Python, I suggest to learn the basics of Python, then take this course.


Sorry to say, but that is extremely unlikely. Your code has some obvious formatting mistakes.

Python is very strict about the use of indentation. That is how it defines blocks of code.


  • If a function definition starts in column 1, then everything within the function must be indented.
  • For every new for-loop, all of the code within the loop must be indented.

Thank you for your response! Yes, I am new to python. Any course suggestions to learn

Thank you for your response! I made the corrections.

Maybe this course helps you.