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)
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
Hi Prafful!
If you've set the two commands to be separate, like this:
Best,
Martin
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