CHARACTER SET
A set of valid characters recognized by python. Python uses the traditional ASCII character set. The latest version recognizes the Unicode character set. The ASCII character set is a subset of the Unicode
Character set
Letters :–A-Z, a-z
Digits :– 0-9
Special symbols :– special symbol available over keyboard
White spaces:– blank space, tab, carriage return, new line, form feed
Other characters:- Unicode
TOKEN
Smallest individual unit in a program is known as token.
1. Keywords
2. Identifiers
3. Literals
4. Operators
5. Punctuators
Keywords
Keywords are reserved words that convey a special meaning to the language compiler. Reserve word of the compiler/interpreter which can’t be used as identifier.
Identifiers
An identifier is a sequence of letters and numbers. Identifier is name used to identify a variable, function, class, module or other object. It is created by programmer using characters.
- An identifier starts with a letter A to Z or a to z or an underscore (_) followed by zero or more letters, underscores and digits (0 to 9).
- Programming languages does not allow special characters.
- Identifier must not be a keyword
- It is a case sensitive programming language. Because, it treats upper and lower case characters differently
Literals
Literals can be defined as number, text, or other data that represent values to be stored in variables. They are data items that never change their values during a program run.
Operators
Operators can be defined as symbols that are used to perform operations on operands
Types of operators
1. Arithmetic Operators.
2. Relational Operators.
3. Assignment Operators.
4. Logical Operators.
5. Bitwise Operators
6. Membership Operators
7. Identity Operators
Punctuators / Separators
It is used to implement the grammatical and structure of a syntax and enhances program's readability and give proper meaning to statements, expressions, etc. These are the punctuators. [ ] ( ) { } , ; : * = #
0 Comments:
Post a Comment