Python Keywords

Python is a cross-platform programming language, which means that it can run on multiple platforms like Windows, macOS, Linux, etc.

  1. Python is free and open-source.
  2. Python is the easiest language to learn.
  3. Python is a case-sensitive language.
  4. Python is used in 

  • Machine Learning
  • Web Development
  • Data Analysis
  • Scientific research
  • Automation

Keywords

Keywords are the reserved words in python, Keywords are used to define the syntax and structure of the python language.

we cannot use a keyword as a variable name, function name, or any other identifier.

There are 33 keywords in python 3.7, All keywords except True, False, and None are in lower case.


Below are the list of keywords

and

else

is

import

as

except

lambda

or

assert

Flase

None

pass

async

for

not

raise

await

from

nonlocal

return

class, def

global

finally

try

del

if

True

while

elif

in

continue

with, yield


To print the list of keywords, use the below code.


#to print the list of keywords in python

import keyword

print(keyword.kwlist)-

Note: let's learn more about python keywords in next chapter.

Comments

Popular posts from this blog