这里列出了所有Python中的关键字和内建方法,你可以把它们都写在本子上,每弄清楚了一个就标记一个,直到全部明白。 ##关键字 Python中的关键字代表特定的含义,不能用于变量名,具体如下:
and | del | from | not | while |
as | elif | global | or | with |
assert | else | if | pass | yield |
break | except | import | ||
class | exec | in | raise | |
continue | finally | is | return | |
def | for | lambda | try |
注print和exec在3.X版本中变成了内建方法
##内建方法 Python中有一些内建方法,下面按照字母序罗列出来,你可以把它们都写在本子上,每弄清楚了一个就标记一,直到全部明白:
abs() | dict() | help() | min() | setattr() |
all() | dir() | hex() | next() | slice() |
any() | divmod() | id() | object() | sorted() |
ascii() | enumerate() | input() | oct() | staticmethod() |
bin() | eval() | int() | open() | str() |
bool() | exec() | isinstance() | ord() | sum() |
bytearray() | filter() | issubclass() | pow() | super() |
bytes() | float() | iter() | print() | tuple() |
callable() | format() | len() | property() | type() |
chr() | frozenset() | list() | range() | vars() |
classmethod() | getattr() | locals() | repr() | zip() |
compile() | globals() | map() | reversed() | __import__() |
complex() | hasattr() | max() | round() | |
delattr() | hash() | memoryview() | set() |