Keywords are reserved words, having their special meaning in python. You can not use any of the python keyword as identifier. Keywords in python used to perform some particular task.
Here, the following table lists keywords available in Python programming:
Here is an example in python uses some python keywords listed in the above table:
while True: print("Enter 'x' for exit.") name = input("Enter your name: ") ntime = int(input("How many time you want to print your name ? ")) if name == 'x': break else: for i in range(0, ntime): print(name) print()
Here is the sample run of the above python program illustrating the use of keywords in a python program:
As you can see from the above snapshot, all the word in red color are keywords of python language. Here are the list of keywords that are used in the above program:
Here are list of some more examples, uses some keywords of python language: