C1W2 assignment


This is the first Exercise .
What is the problem here ?

The problem is your code isn’t creating a matrix that is in row echelon form.

These values are incorrect.

I’m genuinely perplexed. While I fully get all of the lectures, there are some sections of the code that I find confusing. I’m not sure what to do. How should I proceed?

Programming in general and programming in python is a specific set of skills. It requires both understanding the language and how it expresses things as well as how to debug. A lot of people treat the debugging part as if it’s an afterthought or somebody else’s problem, but that’s the wrong way to look at it: it’s an absolutely key part of the job. The code is not done until it works, right? Figuring out how to understand what your code is really doing is key. There are more sophisticated ways to debug by using interactive debuggers, but I usually just use the old-fashioned “print statement” approach. Anytime your code is not working, start putting in print statements to see what is actually happening. You can then comment them out or delete them once you figure out the issue.

If all this is relatively new to you, the best way forward is to keep working at it and to supplement your knowledge with other sources of information like python courses or tutorials.

It is also possible to get direct help with your code in cases in which you have tried hard, but still can’t figure it out. We aren’t supposed to share code on a public thread like this, but there are private ways to share code. I’ll send you a private message about how that works. We will not write the code for you, but we can point out where the real problems are in most cases.

1 Like

Thanks for you advice . it was really helpful and i passed the first exercise successfully !

1 Like