1.

What are tokens in Python? Name the types of tokens which are allowed in Python?​

Answer»

Answer:

Tokens are the smallest ELEMENTS of a program, which are meaningful to the compiler.

There're 5 types of tokens allowed in Python.

Which are-

Keywords : for, del, ELIF, else etc.

Identifiers : Variable names LIKE balance, class names like Vehicle etc.

Literals : String, Numeric, Boolean like ‘abcd’, NONE etc.

Operators : UNARY, Binary, Bitwise like ‘+’, ‘&’, ‘^’ etc

Punctuators : Symbols like ‘#’, ‘(‘, ‘[‘, ‘=’ etc.

Explanation:

It just try to explain theory base form.



Discussion

No Comment Found