Page 1 of 1

Numpy Array

Posted: Thu May 14, 2020 9:19 am
by SHRIRANG
As specified in the Udemy Course, I typed the code in Jupyter Notebook but it does not run.
Can you tell me why? or some other alternative to make it run?


Code:

L2 =[]
for e in L:
L2.append(e**2)

Re: Numpy Array

Posted: Thu May 14, 2020 9:50 pm
by lazyprogrammer
What do you mean by "does not run?"

The #1 source of student error is copying code incorrectly. Therefore, the first thing one should always do is cross-reference with the working code.

You can simply hit the "play" button on Google Colab to confirm that the provided code works.