Last answered:

29 Mar 2020

Posted on:

28 Mar 2020

1

Learning Python Programming - Everything You Should Know

Numbers = [1, 5, 64, 24.5] sum(Numbers) showing error-
NameError                                 Traceback (most recent call last)
<ipython-input-13-a8c02ab2727d> in <module>
----> 1 sum(Numbers)

NameError: name 'Numbers' is not defined

please explain, i did everything exactly same yet there is an error

thank you!
2 answers ( 0 marked as helpful)
Instructor
Posted on:

29 Mar 2020

0
Hi Prafful,  I copied your example and it runs fine on my computer. Could you maybe try restarting the kernel and then running it again? Best,  Eli
Instructor
Posted on:

29 Mar 2020

0
Hi Prafful! If you've set the two commands to be separate, like this:
Numbers = [1, 5, 64, 24.5]
and then you have
sum(Numbers)
in a separate code cell, please make sure to execute both of them in this order, from top to bottom. Hope this helps.
Best,
Martin

Submit an answer