Python 之关键字

Python 之关键字

以下标识符被作为语言的保留字或称关键字,不可被用作普通标识符。关键字的拼写必须与这里列出的完全一致。

Python3

False      await      else       import     pass
None       break      except     in         raise
True       class      finally    is         return
and        continue   for        lambda     try
as         def        from       nonlocal   while
assert     del        global     not        with
async      elif       if         or         yield

Python2

and       del       from      not       while
as        elif      global    or        with
assert    else      if        pass      yield
break     except    import    print
class     exec      in        raise
continue  finally   is        return
def       for       lambda    try
上一篇:Python3 错误和异常-(try/except/else/finally/raise/assert)


下一篇:Python异常-try、raise语句及自定义异常类