hello word

时间:2019-11-10 10:01:04   收藏:0   阅读:84

虽然之前已经学了2个月python,但仍然感觉学的很乱,没有系统性;或者说自学的没有条例,只是追求进度,没有保证知识点的全面与准确。

从今天开始,从python的基础变量开始重新整理知识点,梳理忽略的内容。愿所学即所会,所会即能用。

1、变量名遵循的规则

2、变量名错误常见错误提示:

转引《python:从入门到实践》中的附录

        Python关键字和内置函数

4 Python关键字和内置函数 Python包含一系列关键字和内置函数,给变量命名时,知道这些关键字和内置函数很重要。编程中面临的一个挑战是给变量指定合适的名称,变量名可以是任何东西,只要它长短 合适并描述了变量的作用。同时,不能将Python关键字用作变量名;也不应将Python内置函数的名称用作变量名,否则将覆盖相应的内置函数。 本节将列出Python关键字和内置函数的名称,让你知道应避免使用哪些变量名。

4.1 Python关键字 下面的关键字都有特殊含义,如果你将它们用作变量名,将引发错误:

Python关键字列表
False class finally is return
None continue for lambda try
True def from nonlocal while
and del global not with
as elif if or yield
assert else import pass  
break expect in raise  

4.2 Python内置函数 将内置函数名用作变量名时,不会导致错误,但将覆盖这些函数的行为:

python内置函数列表
abs() divmod() input() open() staticmethod()
all() enumerate() int() ord() str()
any() eval() isinstance() pow() sum()
basestring() execfile() issubclass() print() super()
bin() file() iter() property() tuple()
bytearray() filter() len() range() type()
callable() float() list() raw_input() unichr()
chr() format() locals() reduce() unicode()
classmethod() frozenset long() reload() vars()
cmp() getattr() map() repr() xrange()
compile() globals() max() reversed()zip() Zip()
complex() hasattr() next() round() _import_()
delattr() hash() object() set() apply()
dict() help() memoryview() setattr() buffer()
dir() hex() min() slice() coerce()
bool() id() oct() sorted() intern()
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!