Python Keywords

Keywords are the reserved words in python.we cannot use a keyword as variable name,function name or any other identifier.they are used to define the syntax and structure of the python language.in python,keywords are case sensitive,the following table are display keyword list.

Keyword

Meaning

and

Logical and.

as

Part of the with as statement.

assert

Assert that something is true.

break

Stop this loop right now.

class

Define a class

continue

Don't process more of the loop,do it again.

def

Define a function

del

Delete from dictionary

elif

Else if condition

else

Else condition

except

If an exception happens,do this.

exec

Run a string as python

finally

Exception or not,finally do this no matter what.

for

Loop over a collection of things.

From

Importing specific parts of a module.

global

Declare that you want a global variable

if

if condition

import

Import a module into this one to use.

in

Part of for loops also a test of X in Y.

is

Like ==

lambda

Create a short anonymous function

not

Logical not

or

Logical or

pass

This block is empty

print

Print this string

raise

Raise an exception when things go wrong.

return

Exit the function with a return value

try

Try this block,and if exception,go to

while

While loop

with

With an expression as a variable do.

Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

You may also like this!