PYHTON CHARACTER SET :
LETTERS : A - Z , a - z
DIGITS : 0 - 9
SPECIAL SYMBOLS : SPACE + - * / ** \ ( ) [ ] { } // = != == < , > . ' ' " ", ; : % ! & # <= >= @ _(underscore)
WHITESPACES : BLANK SPACE , TABS , FORMFEED.
OTHER CHARACTERS : IT CAN PROCESS ALL (ASCII) AND UNICODE AS PART OF DATA AND LITERALS.
TOKENS :
THE SMALLEST INDIVIDUAL UNIT IN PROGRAM IS KNOWN AS A TOKEN.
PYTHON HAS FOLLOWING TOKENS :
1. KEYWORD : A WORD HAVING SPECIAL MEANING RESERVED BY PROGRAMMING LANGUAGE.
EG:- FALSE , ELIF , IN , NOT , IF , AND , TRUE.
2. IDENTIFIERS : IDENTIFEIRS ARE FUNDAMENTAL BUILDING BLOCKS OF A PROGRAM AND ARE USED AS THE GENERAL TERMINOLOGY FOR THE NAMES GIVEN TO DIFFERENT PARTS OF THE PROGRAM.
EG:- 1) FIRST CHARACTER MUST BE A LETTER
2) UNDERSCORE(_) COUNTS AS A LETTER
3) IDENTIFIER MUST NOT BE A KEYWORD OF PYTHON
4) PYTHON IS CASE SENSITIVE
5) AN IDENTIFIER CANNOT CONTAIN A SPECIAL CHARACTER EXCEPT FOR UNDERSCOR(_)
3. LITERALS / VALUES : LITERALS OR VALUES ARE THE DATA TYPES THAT HAVE A FIXED VALUE.
TYPES OF LITERALS
(1) STRING LITERALS
(2) NUMERIC LITERALS
(3) BOOLEAN LITERALS
STRING LITERALS:::::
THE TEXT ENCLOSED IN QUOTES FORMS A STRING LITERAL IN PYTHON
EG:-
"KHUSHI"
"INFORMATICS PRACTICES"
NUMERIC LITERALS::::
NUMERIC WE HAVE 2 DIFFRENT TYPES:
1) INT- POSITIVE OR NEGATIVE WITH NO DECIMAL PLACES
2) FLOAT- REAL NUMBERS WITH A DECIMAL POINT
BOOLEAN LITERALS:::::
A BOLLEAN LITERAL IN PYTHON IS USED TO PRESENT ONE OF THE TWO BOOLEAN VALUES --> 1)TRUE 2)FALSE.
No comments:
Post a Comment