Home » Python

Python Keywords

Python | Keywords: In this tutorial, we are going to learn about the python keywords, what is the keyword in Python, list of the keywords in Python programming language.
Submitted by IncludeHelp, on March 23, 2020

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.

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

Python keyword list

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

In 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

    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

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






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.