I have problem with solving machine learning course1 week3 python assignment. Can anybody help me please?

Hi @sepideh26

If you have problem with the assignment, it would be helpful if you could provide information as to what is not working. For example, error messages, so that the mentor can diagnose the problem correctly and efficiently.

and exercise4:
File “”, line 47
return p
IndentationError: unexpected indent

AttributeError Traceback (most recent call last)
7 tmp_p = predict(tmp_X, tmp_w, tmp_b)
----> 8 print(f’Output of predict: shape {tmp_p.shape}, value {tmp_p}')

AttributeError: ‘NoneType’ object has no attribute ‘shape’

Hi @sepideh26 ,

What is happening here is that an unexpected indentation occurred. Please check for extra indentation before the return statement. It should be inline with the first hedge tag sign before the END CODE HERE comment. Here is what it should look like:

‘###’ END CODE HERE ‘###’
return p
I have to enclose the hedge tag sign with ‘’ in order for it to be seen.
Due to this error, the unit test failed because predict() is unable to return any values, causing the AattributeError as a result.

1 Like