python抛出这种NameError,并提示name 'math' is not defined,那么一般的原因有如下两种:
>>> math
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'math' is not defined
>>> math = 1
>>> math
1
>>> import math
>>> math.e
2.718281828459045
全栈编程 / python教程(可向下滚动):
Copyright © 2022-2023 笨鸟工具 x1y1z1.com All Rights Reserved.