[转载] python关键字和保留字_Python关键字

参考链接: Python关键字和标识符

python关键字和保留字

  关键词 (Keywords) 

 Keywords are the reserved words in Python programming language (and, any other programming languages like C, C++, Java, etc) whose meanings are defined and we cannot change their meanings. In python programming languages, keywords are the case sensitive.  

  关键字是Python编程语言(以及其他任何编程语言,如C,C ++,Java等)中的保留字,其含义已定义,我们无法更改其含义。 在python编程语言中,关键字区分大小写。  

 Note: We cannot use any reserved words (which are known as Keywords) as an identifier (like a variable name, function name, etc). 

  注意 :我们不能使用任何保留字(称为关键词 )作为标识符(如变量名,函数名等)。  

  Python关键字列表 (Python keyword list) 

 Here is the list of Python keywords (the list can be varied based on the Python versions), 

  这是Python关键字的列表(该列表可以根据Python版本而有所不同),  

 In Python 2.5 

  在Python 2.5中  

     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

 

 

 In Python 3.8.1 

  在Python 3.8.1中  

     False   None    True    and     as 

    assert  async   await   break   class 

    continue def    del     elif    else 

    except  finally for     from    global 

    if      import  in      is      lambda 

    nonlocal not    or  pass    raise 

    return  try     while   with    yield

 

 

 Read: Python program to print the list of all keywords 

  阅读: Python程序打印所有关键字的列表  

 Reference: https://docs.python.org/2.5/ref/keywords.html 

  参考: https : //docs.python.org/2.5/ref/keywords.html  

 

  翻译自: https://www.includehelp.com/python/python-keywords.aspx

 

 python关键字和保留字

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值