name 'e' is not defined I ma getting this error in my python code. I have already imported the math and the numpy modules. What more do I need?
'e' the base of natural logarithm in python
1.2k Views Asked by Nisha At
2
name 'e' is not defined I ma getting this error in my python code. I have already imported the math and the numpy modules. What more do I need?
Use
Similar, for example:
This way, it is clear which
e
(orpi
) or meant, instead of a random lettere
somewhere in your code.If you are using NumPy instead, you could do as follows:
(the NumPy import is generally abbreviated to
np
).Both
e
's are the same.