1. Keywords
2. Identifiers
3. Literals
4. Operators
5. Special Symbols
2. Identifiers
3. Literals
4. Operators
5. Special Symbols
1.
Keywords:
Keywords are the reserved words. 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.
False class from orNone continue global passTrue def if raiseand del import returnas elif in tryassert else is whileasync except lambda withawait finally nonlocal yieldbreak for not
2.
Identifiers:
Identifier is the name given to entities like class,
functions, variables etc. In Python, It helps in differentiating one entity
from another.
Rules
for writing identifiers in Python:
- Identifiers can be a combination of letters in lowercase (a to z) or uppercase (A to Z) or digits (0 to 9) or an underscore (_). Names like student, sno, marks, stu_mno, all are valid example.
- An identifier cannot start with a digit. 1variable is invalid, but variable1 is perfectly fine.
- Keywords cannot be used as identifiers.
- We cannot use special symbols like! , @, #, $, % etc. in our identifier.
- Identifier can be of any length.
3. Literals : Literals are constant values
4. Operators: Symbol that used to perform arithmetic and logical operations
Ex : + - < and in << >>
5. Special Symbols: ‘ “ # . \ * + ? [ ] ( ) { } etc.
Ex: subject =
“Computer Science”
Pi = 3.14
“\n” -
newline
“\t” - tab space
4. Operators: Symbol that used to perform arithmetic and logical operations
Ex : + - < and in << >>
5. Special Symbols: ‘ “ # . \ * + ? [ ] ( ) { } etc.
No comments:
Post a Comment