DEV Community

vishwa v
vishwa v

Posted on

python-2

Keyword in python
In Python, keywords are special reserved words that have predefined meanings and cannot be used as identifiers (like variable names, function names, or class names). They are part of the Python language syntax.

we can see all python keywords using below commands:

import keyword
keyword.kwlist
Enter fullscreen mode Exit fullscreen mode

['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']

Datatypes
1.Numeric types:

  • int-postive or negative number
  • float-Decimal points
  • complex-real and imaginary part

2.str type

3.sequence type(list,tuple,range)

4.mapping type:
dict-dictonaries that stores data in key-value pairs

5.set types(set,frozen set)

6.boolean type(True or False)

7.None type

Top comments (0)