Keywords In Python
 

Keywords In Python

 

Like other programming languages, Python also has some reserved words whose meaning is already defined by the Python interpreter these reserved words are known as Keywords.

A keyword cannot be used as the identifier. For example, you can not use a variable with the name def because it is a Python keyword that is used to define a function.

List of keywords in Python

The following table shows the list of Python keywords.

Falseclassfromor
Nonecontinueglobalpass
Truedefifraise
anddelimportreturn
aselifintry
assertelseiswhile
asyncexceptlambdawith
awaitfinallynonlocalyield
breakfornot

Here keywords await and async were recently added in Python 3.7, print and exec were keywords in Python 2.7 now these are changed into built-in Python functions.

You can see the updated list of these keywords in your terminal by using –

help("keywords")

As given in the image below –

Display information of a keyword

You can view the information of each keyword in the terminal by using the help function.

For example to view the details of for keyword use –

help("for")

This will display about for keyword in python along with example you can scroll it to see the complete information.

In python programming, each keyword has its own use. We have seen a few of them in previous articles in upcoming tutorials we will explain to them whenever we use them.

Conclusion

You should know how to use a Python keyword. Before using them first understand them properly. Now if you find any difficulty while using a keyword then write us in the comments below.

Previous Python Strings
Next Operators in Python
 

About author

You might also like

Programming 0 Comments

Python Indentation

An indentation or indent is an empty space at the beginning of a line that signals the start of a new logical block in a Python program. Many programming languages

Programming 0 Comments

Setup Python Development Environment With VS Code In Linux

Visual studio code (VS Code) is a free and open-source IDE that is developed by Microsoft. It is a lightweight IDE that has powerful features like smart code completion, code

Python Programming 0 Comments

Introduction To The Course On Python Programming

Python is a high-level, interpreted, general-purpose programming language. It emphasizes more on code readability so its syntax is simple and easy to use. People from different areas use it for

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply