W2_A2_Ex-2/3_help with basic python

Week 2
Python Basics with Numpy (optional assignment)

On Excercise 2, it says
“Run the code below to see an example with math.exp() .”
But there is no code bellow to run? There is a prompt to enter 1 line of code. I’m completely lost what it is asking me to do.

On Excercise 3, not at all clear what it is asking or where to get the python resources.

Should I take a python class and return to this class after learning more python?

I understand the math and concepts. (I have a strong math background)
I just don’t know anything about python.

Hi, you need to implement the sigmoid function in Python, for that you will need to use math.exp function. You cannot run the code until you’ve completed the function.

I think if you don’t have any knowledge of Python you will need an extra effort to learn that on the go. In my opinion I think you should try to learn some Python before completing this specialization. In fact, in the FAQ you have the expected background, in particular see the question below:

What background knowledge is necessary for the Deep Learning Specialization?


  • Learners should have intermediate Python experience (e.g., basic programming skills, understanding of for loops, if/else statements, data structures such as lists and dictionaries).


  • Learners should have a basic knowledge of linear algebra (matrix-vector operations and notation).
  • Learners should have an understanding of machine learning concepts (how to represent data, what an ML model does, etc.)

Thank you for responding to my question!

In week 1, the FAQ, its really quite different from what you just posted.

" Q: Is there a prerequisite for this course? A: Students are expected to have the following background:

  • Very basic programming skills (i.e. ability to work with dictionaries and for loops)

  • Familiarity with basic machine learning (how do we represent a dataset as a matrix, etc.).

  • Familiarity with the basic linear algebra (matrix multiplications, vector operations etc.)."

This is what was presented to me during the free trial phase of this course. So I felt I met this background knowledge.

Hi, I think the different in requirements could be that those may be for course 1 and the ones I pasted are for the specialization. I guess you could learrn Python on the go, the only thing is that it will be a bit more difficult. Python is not a complex programming language.

I think the best solution is for me to learn python and come back to this course. Thank you for that advice!!!

Someone should update the FAQ in week 1. Since the first week is free, and the FAQ in Week 1 is what someone that is taking the course would pay attention to, and it clearly says something misleading. I carefully read through this before deciding to continue the course after the trial week, and start paying the monthly fee. (Expecting students to cross reference the FAQ that is actually part of the course, part of the Week 1 material, with the the deeplearning website seems a bit much)

I feel like this mistake stole $50 from my wallet. And wasted a lot of my time (and some of yours).

Alberto I’m at the same point of Bryce
I have enrolled 2 days ago and I passed the w2 test

" you need to implement the sigmoid function in Python, for that you will need to use math.exp function. You cannot run the code until you’ve completed the function"
I do not understand what do you mean with you 've to complete the function math.exp
May I see the answer please I think is the only way I can undestand
It’s a basic and optional exercise why there’s not any answer to check

You don’t have to write the function math.exp. That is given to you from the math library of python. The point is that saying math.exp(x) is the python equivalent of the math function e^x. Now you need to use that knowledge to write the sigmoid function. They give you the formula in the instructions. Note that e^x is just part of the formula, right? They have given you the basic template with the definition of the function and you need to fill in the code for the core part of the algorithm in the “YOUR CODE HERE” section.

Note that if you are not already a reasonably competent python programmer, you might want to take a python course first. If you have solid experience in other programming languages, you can probably just read a few tutorials about python and pick it up on the fly. But if this is literally your first exposure to programming of any kind, then you should really take a python course first.

Also note that this thread is almost 2 years old. There’s no guarantee that people who participated in the original thread are still listening. It’s fine to try and you got lucky in this case that someone else noticed, but failing that you should try starting a new thread in the appropriate category (DLS Course 1 in this case).