python中的保留字

python 中有很多保留字和有特殊含义的单词,它们不适合作为变量名或函数名或类名

You may not name your variables any of the following words as they mean special things in Python:

and assert break class continue
def del elif else except
exec finally for from global
if import in is lambda
not or pass print raise
return try while

Do NOT use any of the following words either (although they are not strictly Python reserved words, they conflict with the names of commonly-used Python functions):

Data Float Int Numeric Oxphys
array close float int input
open range type write zeros

You should also avoid all the names defined in the math library (you must avoid them if you import the library):

acos asin atan cose
exp fabs floor log log10
pi sin sqrt tan

猜你喜欢

转载自blog.csdn.net/linkequa/article/details/84927289