Graded Assignment Python help for non-programmer

It seems like there would have been more signal in the forum if it was otherwise, as no one would have matched Expected Output. Thanks for confirming. Also serves as a reminder to @dvvilkins and others to not modify code outside the ###YOUR CODE HERE### tags. Self-inflicted but entirely avoidable pain likely to ensue.

Hi dvvilkins, the quickest way to get up to speed is to rock through CodeAcadamy’s Python class, Learn Python 2 | Codecademy. I link to the Python2 class because it’s free. It will probably take 5-8 hours.

I also recommend reading through The Python Tutorial — Python 3.11.2 documentation up through section 9 (the section on classes). You won’t need anything past that.

My last advice is that Numpy is very expressive, which means that a lot of meaning is packed into a single line of code. Don’t feel bad about spending an hour playing with the function just to understand what it does.

Oh, and last thing: Chat GPT! Try asking Chat GPT questions. It’s wrong 10% of the time, but it’s right 90% of the time. So, you can ask Chat GPT for the code, paste it into the notebook, and try it yourself. Ask it questions like, “this is my code, what does this variable mean?” or “what is this function doing?” or “how do I double the value of every entry in a numpy array?”

Great tips, @Owen_Brown ! I never thought of using ChatGPT that way but it makes sense.

@ai_curious This is true. I must have changed the return when trying to figure out what def function did and how it worked.